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:
Sun Mar 08 14:45:02 2020 +0000
Revision:
1:7f0e80fcb3a0
Parent:
0:76248fdccc2a
Added NTP set RTC function.

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 1:7f0e80fcb3a0 19 "mbed-trace.enable": true,
star297 0:76248fdccc2a 20 "mbed-http.http-buffer-size": 2048,
star297 0:76248fdccc2a 21 "nsapi.default-wifi-security": "WPA_WPA2",
star297 1:7f0e80fcb3a0 22 "nsapi.default-wifi-ssid": "\"Molino Metz\"",
star297 1:7f0e80fcb3a0 23 "nsapi.default-wifi-password": "\"36693557\""
star297 0:76248fdccc2a 24 },
star297 1:7f0e80fcb3a0 25 "NUCLEO_L476RG": {
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 1:7f0e80fcb3a0 32 "DISCO_L476VG": {
star297 1:7f0e80fcb3a0 33 "target.network-default-interface-type" : "WIFI",
star297 1:7f0e80fcb3a0 34 "esp8266.serial-baudrate" : 230400,
star297 1:7f0e80fcb3a0 35 "esp8266.tx" : "PB_6",
star297 1:7f0e80fcb3a0 36 "esp8266.rx" : "PB_7",
star297 1:7f0e80fcb3a0 37 "esp8266.provide-default" : true
star297 1:7f0e80fcb3a0 38 },
star297 0:76248fdccc2a 39 "NUCLEO_F446ZE": {
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 "NUCLEO_F767ZI": {
star297 1:7f0e80fcb3a0 47 "target.network-default-interface-type" : "ETHERNET",
star297 1:7f0e80fcb3a0 48 "esp8266.serial-baudrate" : 460800,
star297 1:7f0e80fcb3a0 49 "esp8266.tx" : "D1",
star297 1:7f0e80fcb3a0 50 "esp8266.rx" : "D0",
star297 1:7f0e80fcb3a0 51 "esp8266.provide-default" : true
star297 1:7f0e80fcb3a0 52 },
star297 1:7f0e80fcb3a0 53 "NUCLEO_H743Z12": {
star297 1:7f0e80fcb3a0 54 "target.network-default-interface-type" : "ETHERNET",
star297 0:76248fdccc2a 55 "esp8266.serial-baudrate" : 460800,
star297 0:76248fdccc2a 56 "esp8266.tx" : "D1",
star297 0:76248fdccc2a 57 "esp8266.rx" : "D0",
star297 0:76248fdccc2a 58 "esp8266.provide-default" : true
star297 0:76248fdccc2a 59 },
star297 0:76248fdccc2a 60 "DISCO_F746NG": {
star297 1:7f0e80fcb3a0 61 "target.network-default-interface-type" : "ETHERNET",
star297 0:76248fdccc2a 62 "esp8266.serial-baudrate" : 460800,
star297 0:76248fdccc2a 63 "esp8266.tx" : "D1",
star297 0:76248fdccc2a 64 "esp8266.rx" : "D0",
star297 0:76248fdccc2a 65 "esp8266.provide-default" : true
star297 1:7f0e80fcb3a0 66 },
star297 1:7f0e80fcb3a0 67 "DISCO_F469NI": {
star297 1:7f0e80fcb3a0 68 "target.network-default-interface-type" : "WIFI",
star297 1:7f0e80fcb3a0 69 "esp8266.serial-baudrate" : 230400,
star297 1:7f0e80fcb3a0 70 "esp8266.tx" : "PC_6",
star297 1:7f0e80fcb3a0 71 "esp8266.rx" : "PC_7",
star297 1:7f0e80fcb3a0 72 "esp8266.provide-default" : true
star297 0:76248fdccc2a 73 }
star297 0:76248fdccc2a 74 }
star297 0:76248fdccc2a 75 }
star297 0:76248fdccc2a 76