GithubHelp home page GithubHelp logo

air's Introduction

Air firmware

===========
== FILES ==
===========
user/user_html.c: 	Set of functions to extract usefull data from a page request (GET/POST, page name, query param) 
					Set of functions to return a page after a request

user/user_led.c:	Driver for red, green et blue leds

user/user_main.c: 	Entry point. Set esp8266 in Station and softAP mode.
					Start main state machine
					Start TCP Server
					Start a task to capture data from SDS011
					Start a task to scan wifi networks
					
user/user_mqtt.c:	To send mqtt messages to our server
					
user/user_pages.c:	Each function handles a web page for a given protocol (GET, POST or both)

user/user_queue.c:	To create queues which are used for inter tasks communication

user/user_spiffs.c: Spiffs init
										
user/user_sds011.c:	Driver for SDS011 (PM2.5 & PM10 sensor)
					Use GPIO4 (RX) and GPIO5 (TX) to connect to SDS011 uart port
					
user/user_tcp_client.c:	TCP client, used to send device registration to our server

user/user_tcp_server.c:	TCP server + table to map functions and web page

user/user_test.c:	Unit tests

user/user_wifi.c:	Task for wifi scan and setuping wifi

library/utf8.c:		To convert UTF8 char to ASCII char (used when converting password with special characters)

=================
== COMPILATION ==
=================
= Env variables =
export BIN_PATH=/path/to/binary/output 	(already set in Eclipse project configuration)
export SDK_PATH=/path/to/esp8266/sdk	(already set in .bashrc for me) (tag v2.x.x)

= Compiler =
You need xtensa-lx106-elf cross compilation tools (version xtensa-lx106-elf-gcc (crosstool-NG 1.20.0) 4.8.2) (available on espressif web site)
Or:
Get it from esp-open-sdk:  https://github.com/pfalcon/esp-open-sdk 
Clone in recursive mode. Install the required packages. Compile not in standalone mode.

= To compile =
make BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=0

==============
== FLASHING ==
==============
To be called from ${BIN_PATH}
esptool.py --port /dev/ttyUSB0 -b 460800 write_flash 0x00000 eagle.flash.bin 0x20000 eagle.irom0text.bin 0x3fc000 /home/gautier/git/ESP8266_RTOS_SDK/bin/esp_init_data_default.bin 0x3fe000 /home/gautier/git/ESP8266_RTOS_SDK/bin/blank.bin

=============
==  DEBUG  ==
=============
To be called from ${BIN_PATH}
gdbcmds should be copied from esp-gdbstub to ${BIN_PATH}
Uncomment call to gdbstub_init() in user_main.c before launching it.
~/git/esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-gdb -x gdbcmds -tui -b 115200 ~/workspace/air/.output/eagle/DEBUG/image/eagle.app.v6.out
Or launch it from Eclipse (do not forget to put a breakpoint before launching it)


==================
== ARCHITECTURE ==
==================
See UML file air in plan folder

## HTML ##
The pages are stored in a spiffs image.
The spiffs image is flashed to the board at address 0x300000 with command esptool.py --port /dev/ttyUSB0 -b 460800 write_flash 0x300000 spiffs-image.bin
The pages are stored in the folder spiffs/data. Spiffs image is created with command ~/git/mkspiffs/mkspiffs -p 256 -b 8192 -s 0xfa000 -c data/ spiffs-image.bin 
The http header is added by a call to html_add_header()


## Wifi scan ##
A task (task_wifi_scan())is dedicated for scanning wifi networks. A scan is done by calling wifi_station_scan().
When scan is done, scan_done() is called.
Data are then read and for each network a message is queued.

## Main ##
See UML file air in plan folder																														Goto (2)				Goto (3)

===============
== WEB PAGES ==
===============
/wifi.html: Page used to display all wifi network and let user select the one he wants to connect to
/connect.html: To retrieve the ssid name and password of the wifi ssid the user wants to connect to
													
===========
== TO DO ==
===========
See github issues

air's People

Contributors

sideralis avatar

Watchers

James Cloos avatar  avatar

air's Issues

mac adress is not correct

if one part of mac address starts with a zero, this zero is omitted.
For example 38:2b:78:03:d7:1d is sent as 38:2b:78:3:d7:1d

A device may be partially registered

It may (or may not?) happen that during a registration something is going wrong. In this case, the device may be registered at server side, but not at device side, meaning that the device does not have any token.
A new registration will fail as the device will get already registered and not the token!

MQTT status

Device should send a running/not running status.
When connecting, send a lastWillMessage = "offline", and lastWillRetain = true, and then send a publish message= "online", and retainedFlag = true

Implement NTP

Device should know the time with precision to be able to associate the measurements with a time reference.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.