Firebase example. demonstrating PUT, POST and GET functions. Requires target MCU with at least 280kB Flash/33kB RAM. Tested on STM32F767 and STM32F446 boards using ETHERNET (STM32F767) and ESP8266 WIFI. Edit the mbed_app.json file to change interface, currently set to ESP8266 WIFI at 460800 baud, the default is 115200 baud. however its much more responsive at 460800 if you can use the AT command AT+UART_DEF? (see Espressif instruction set). Using TLSSocket reuse function(default) or can be set to open a new socket per request. Random dummy sensor values are used, just add some real sensors and edit the getSENSORS function. The data format is .json style and need to be wrapped in curly braces. Go to: https://firebase.google.com/products/realtime-database/ and set up a real-time database, takes a couple of minutes, and get your Project ID and Web API key from the Database/settings page. These are entered in the Firebase.h file. Added NTP RTC time set function.

Dependencies:   NTPclient Firebase-https

Committer:
star297
Date:
Thu Jan 23 22:33:09 2020 +0000
Revision:
0:76248fdccc2a
Child:
1:7f0e80fcb3a0
Initial revision

Who changed what in which revision?

UserRevisionLine numberNew contents of line
star297 0:76248fdccc2a 1 {
star297 0:76248fdccc2a 2 "config": {
star297 0:76248fdccc2a 3 "main-stack-size": {
star297 0:76248fdccc2a 4 "value": 8192
star297 0:76248fdccc2a 5 }
star297 0:76248fdccc2a 6 },
star297 0:76248fdccc2a 7 "macros": [
star297 0:76248fdccc2a 8 "MBEDTLS_MPI_MAX_SIZE=1024",
star297 0:76248fdccc2a 9 "MBEDTLS_MPI_WINDOW_SIZE=1",
star297 0:76248fdccc2a 10 "MBEDTLS_USER_CONFIG_FILE=\"mbedtls_entropy_config.h\"",
star297 0:76248fdccc2a 11 "MBEDTLS_TEST_NULL_ENTROPY",
star297 0:76248fdccc2a 12 "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES",
star297 0:76248fdccc2a 13 "MBED_HEAP_STATS_ENABLED=1"
star297 0:76248fdccc2a 14 ],
star297 0:76248fdccc2a 15 "target_overrides": {
star297 0:76248fdccc2a 16 "*": {
star297 0:76248fdccc2a 17 "platform.stdio-baud-rate": 921600,
star297 0:76248fdccc2a 18 "platform.stdio-convert-newlines": true,
star297 0:76248fdccc2a 19 "mbed-trace.enable": null,
star297 0:76248fdccc2a 20 "mbed-http.http-buffer-size": 2048,
star297 0:76248fdccc2a 21 "nsapi.default-wifi-security": "WPA_WPA2",
star297 0:76248fdccc2a 22 "nsapi.default-wifi-ssid": "\"SSID\"",
star297 0:76248fdccc2a 23 "nsapi.default-wifi-password": "\"PASSWORD\""
star297 0:76248fdccc2a 24 },
star297 0:76248fdccc2a 25 "NUCLEO_F401RE": {
star297 0:76248fdccc2a 26 "target.network-default-interface-type" : "WIFI",
star297 0:76248fdccc2a 27 "esp8266.serial-baudrate" : 460800,
star297 0:76248fdccc2a 28 "esp8266.tx" : "D8",
star297 0:76248fdccc2a 29 "esp8266.rx" : "D2",
star297 0:76248fdccc2a 30 "esp8266.provide-default" : true
star297 0:76248fdccc2a 31 },
star297 0:76248fdccc2a 32 "NUCLEO_F446ZE": {
star297 0:76248fdccc2a 33 "target.network-default-interface-type" : "WIFI",
star297 0:76248fdccc2a 34 "esp8266.serial-baudrate" : 460800,
star297 0:76248fdccc2a 35 "esp8266.tx" : "D1",
star297 0:76248fdccc2a 36 "esp8266.rx" : "D0",
star297 0:76248fdccc2a 37 "esp8266.provide-default" : true
star297 0:76248fdccc2a 38 },
star297 0:76248fdccc2a 39 "NUCLEO_F767ZI": {
star297 0:76248fdccc2a 40 "target.network-default-interface-type" : "WIFI",
star297 0:76248fdccc2a 41 "esp8266.serial-baudrate" : 460800,
star297 0:76248fdccc2a 42 "esp8266.tx" : "D1",
star297 0:76248fdccc2a 43 "esp8266.rx" : "D0",
star297 0:76248fdccc2a 44 "esp8266.provide-default" : true
star297 0:76248fdccc2a 45 },
star297 0:76248fdccc2a 46 "DISCO_F746NG": {
star297 0:76248fdccc2a 47 "target.network-default-interface-type" : "WIFI",
star297 0:76248fdccc2a 48 "esp8266.serial-baudrate" : 460800,
star297 0:76248fdccc2a 49 "esp8266.tx" : "D1",
star297 0:76248fdccc2a 50 "esp8266.rx" : "D0",
star297 0:76248fdccc2a 51 "esp8266.provide-default" : true
star297 0:76248fdccc2a 52 }
star297 0:76248fdccc2a 53 }
star297 0:76248fdccc2a 54 }
star297 0:76248fdccc2a 55