Git Product home page Git Product logo

anavi-thermometer-sw's Introduction

ANAVI Thermometer software

This repository contains the default open source Arduino sketch for the smart WiFi dev board ANAVI Thermometer.

You can build and upload the sketch through the Arduino IDE or download a pre-compiled binary of a stable release and flash it with esptool. It you just want to upload the latest stable release it is easier and recommended to use esptool.py.

User Guide

ANAVI Thermometer User's Manual

Dependencies

The default firmware of ANAVI Thermometer depends on the following Arduino libraries, which must be added in the Arduino IDE before compiling the sketch.

anavi-thermometer-sw's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anavi-thermometer-sw's Issues

Have a static version with all parameters set at compile time

I see all the interest of using a device opening an access-point to allow configuration at first boot; but sometime, you just flash and re-flash the device for a well known location and hard-coding parameters in the code can be better.

Would you consider pull request with #define and #ifdef to allow both dynamic (current mode with access-point) and static (parameters set at compile time)?

version >= 1.0.2 won't connect to mqtt broker

If I install version 1.0.1, it works fine.

But if I then install version 1.0.2 or 1.0.3 it doesn't appear to be sending any messages to my mosquitto server. I suspect it can't connect to the server for some reason. wifi is connected though.

If I then install version 1.0.1 again it works fine.

If I work anything else out I will add here.

Maybe something wrong with mqtt authentication???

error: 'const char HTTP_HEAD []' redeclared as different kind of symbol

I follow the instructions from the ANAVI thermometer Development chapter in an Arduino IDE fresh install, version 1.8.12

When I click Verify I get this error:

In file included from /home/atd/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/include/sys/stdio.h:6:0,
                 from /home/atd/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/include/stdio.h:63,
                 from /home/atd/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/cores/esp8266/Arduino.h:32,
                 from sketch/anavi-thermometer-sw.ino.cpp:1:
/home/atd/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h:25:130: error: 'const char HTTP_HEAD []' redeclared as different kind of symbol
   #define PROGMEM __attribute__((section( "\".irom.text." __FILE__ "." __STRINGIZE(__LINE__) "."  __STRINGIZE(__COUNTER__) "\"")))
                                                                                                                                  ^
/home/atd/Arduino/libraries/WiFiManager/WiFiManager.h:25:24: note: in expansion of macro 'PROGMEM'
 const char HTTP_HEAD[] PROGMEM            = "<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\"/><title>{v}</title>";
                        ^
In file included from /home/atd/dev/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:230:0:
/home/atd/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WebServer/src/ESP8266WebServer.h:33:39: error: previous declaration of 'HTTPMethod HTTP_HEAD'
 enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
                                       ^
exit status 1
Error compilando para la tarjeta Generic ESP8266 Module.
Exception in thread "AWT-EventQueue-0" java.util.ConcurrentModificationException
	at java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1239)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at cc.arduino.contributions.libraries.LibrariesIndexer.rescanLibraries(LibrariesIndexer.java:167)
	at processing.app.BaseNoGui.onBoardOrPortChange(BaseNoGui.java:681)
	at processing.app.Base.onBoardOrPortChange(Base.java:1336)
	at processing.app.Base$12.actionPerformed(Base.java:1566)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:308)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886)
	at java.awt.Component.processMouseEvent(Component.java:6539)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6304)
	at java.awt.Container.processEvent(Container.java:2239)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

MQTT esp8266 failed, rc=-1 error

I have just uploaded the sketch from master branch using the instructions in the documentation, but I have to issues:

  • MQTT connection does not work
  • OLED Display is only on when USB to UART is disconnected. It remains blank and the red D1 led remains on

I have double checked the library versions and everything seems to be ok

The output from Arduino IDE when uploading

Executable segment sizes:
IROM   : 381628          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 28572   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 
DATA   : 1632  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 4988  ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 32960 )         - zeroed variables      (global, static) in RAM/HEAP 
El Sketch usa 416820 bytes (39%) del espacio de almacenamiento de programa. El máximo es 1044464 bytes.
Las variables Globales usan 39580 bytes (48%) de la memoria dinámica, dejando 42340 bytes para las variables locales. El máximo es 81920 bytes.
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: xx:xx:xx:xx
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 420976 bytes to 298538...

Writing at 0x00000000... (5 %)
Writing at 0x00004000... (10 %)
Writing at 0x00008000... (15 %)
Writing at 0x0000c000... (21 %)
Writing at 0x00010000... (26 %)
Writing at 0x00014000... (31 %)
Writing at 0x00018000... (36 %)
Writing at 0x0001c000... (42 %)
Writing at 0x00020000... (47 %)
Writing at 0x00024000... (52 %)
Writing at 0x00028000... (57 %)
Writing at 0x0002c000... (63 %)
Writing at 0x00030000... (68 %)
Writing at 0x00034000... (73 %)
Writing at 0x00038000... (78 %)
Writing at 0x0003c000... (84 %)
Writing at 0x00040000... (89 %)
Writing at 0x00044000... (94 %)
Writing at 0x00048000... (100 %)
Wrote 420976 bytes (298538 compressed) at 0x00000000 in 26.4 seconds (effective 127.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

The output from the serial monitor:

s$l⸮⸮⸮�⸮#�⸮o��⸮�⸮l⸮�b|⸮⸮�⸮p�⸮{⸮c⸮c⸮⸮on⸮$oN⸮⸮⸮c�p⸮$s$r$p⸮o⸮���⸮l�⸮⸮�c�n⸮|�l⸮l⸮#⸮|�⸮o⸮l⸮⸮l �⸮��nod`���nr⸮⸮⸮N�⸮�l`��{⸮⸮o⸮�d`�⸮r⸮p⸮�l⸮{�⸮ �⸮⸮N⸮�
MQTT: 1+N: Using single connection, multiple status topics
Mini I2C OLED Display at address 3C: OK
Press button within 2 seconds for factory reset...
mounting FS...
mounted file system
reading config file
opened config file
{"mqtt_server":"192.168.x.x","mqtt_port":"1883","workgroup":"xxx","username":"","password":"","temp_scale":"celsius","ha_name":"xxx","ota_server":""}
parsed json
*WM: Adding parameter
*WM: server
*WM: Adding parameter
*WM: port
*WM: Adding parameter
*WM: workgroup
*WM: Adding parameter
*WM: user
*WM: Adding parameter
*WM: pass
*WM: Adding parameter
*WM: temp_scale
*WM: Adding parameter
*WM: ha_name
*WM: Adding parameter
*WM: ota_server
*WM: Adding parameter
*WM: 
*WM: 
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Status:
*WM: 6
*WM: Using last saved values, should be faster
*WM: Connection result: 
*WM: 3
*WM: IP Address:
*WM: 192.168.x.x
connected...yeey :)
local ip
192.168.x.x
MQTT Server: 192.168.x.x
MQTT Port: 1883
No MQTT username
No MQTT password
Saved temperature scale: celsius
Temperature scale: Celsius
Home Assistant sensor name: xxx
No OTA server
MQTT esp8266 failed, rc=-1

-----
Machine ID: xxx
-----

*WM: freeing allocated params!
Home Assistant discovery topic: homeassistant/sensor/xxx/temp/config
beginPublish failed!

Home Assistant discovery topic: homeassistant/sensor/xxx/humidity/config
beginPublish failed!

DHT Heat Index: 24.0°C
Air 24.5°C
Humidity 40%
WiFi -59 dBm
....

Mosquitto server logs:

1584219564: New connection from 192.168.x.x on port 1883.
1584219564: Socket error on client <unknown>, disconnecting.
1584219614: New connection from 192.168.x.x on port 1883.
1584219614: Socket error on client <unknown>, disconnecting.
1584219674: New connection from 192.168.x.x on port 1883.
1584219674: Socket error on client <unknown>, disconnecting.
1584219734: New connection from 192.168.x.x on port 1883.
1584219734: Socket error on client <unknown>, disconnecting.
1584219794: New connection from 192.168.x.x on port 1883.
1584219794: Socket error on client <unknown>, disconnecting.
1584219854: New connection from 192.168.x.x on port 1883.
1584219854: Socket error on client <unknown>, disconnecting.
...

OTA update security

While the OTA update is great for everyone that does use a private MQTT, this is a pretty big security issue for people that use public servers, as anyone can trigger an update with any firmware of their choice, as long as they know the machine id. While the machine ID is hard to guess, it may be easy to intercept from the subscription messages or people may share their ID openly, not realizing the potential consequences.

I am not sure how to best handle this. Three quick ideas ideas I have:

  • disable OTA update via build flag by default and add documentation about the potential implications of enabling (the feature is probably only useful for people that know how to build their own image anyway)
  • by default, allow OTA update only from local webservers (10.*, 192.168, 172.16-31)
  • require user consent by pressing the reset button before updating

(I like the third option the most)

Either way, I feel like it would be good to not be part of the usual IoT security negligence :)

I will try to implement and create a PR for option 3 in the next days but I am open for other suggestions.

Default Eclipse broker has changed

By default, the thermometer sketch / wifi configuration page attempts to send MQTT messages via iot.eclipse.org, which does not work.

The current sandbox MQTT broker for Eclipse is mqtt.eclipseprojects.io

(also, where is the code for the web config page - is that run separately from the ESP flashed sketch?)
figured this ^^ out, it is from WifiManager

Migrate to LittleFS for ESP8266

Compiling against the current version of the libraries and Generic 8266 board support, results in these warnings:

Compiling sketch...
/Users/andypiper/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I /Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/signing.py --mode header --publickey /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/public.key --out /var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino_build_441567/core/Updater_Signing.h
/Users/andypiper/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/lwip2/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/libc/xtensa-lx106-elf/include -I/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino_build_441567/core -c -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_GENERIC\"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/variants/generic -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266httpUpdate/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266HTTPClient/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/DNSServer/src -I/Users/andypiper/Documents/Arduino/libraries/NTPClient -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer/src -I/Users/andypiper/Documents/Arduino/libraries/WiFiManager -I/Users/andypiper/Documents/Arduino/libraries/ArduinoJson/src -I/Users/andypiper/Documents/Arduino/libraries/PubSubClient/src -I/Users/andypiper/Documents/Arduino/libraries/DHT_sensor_library -I/Users/andypiper/Documents/Arduino/libraries/U8g2/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/Wire -I/Users/andypiper/Documents/Arduino/libraries/OneWire -I/Users/andypiper/Documents/Arduino/libraries/DallasTemperature -I/Users/andypiper/Documents/Arduino/libraries/Adafruit_HTU21DF_Library -I/Users/andypiper/Documents/Arduino/libraries/Adafruit_BusIO -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/SPI -I/Users/andypiper/Documents/Arduino/libraries/Adafruit_APDS9960_Library -I/Users/andypiper/Documents/Arduino/libraries/Adafruit_Unified_Sensor -I/Users/andypiper/Documents/Arduino/libraries/Adafruit_BMP085_Unified /var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino_build_441567/sketch/anavi-thermometer-sw.ino.cpp -o /var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino_build_441567/sketch/anavi-thermometer-sw.ino.cpp.o
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino: In function 'void load_calibration()':
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:887:10: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
  887 |     if (!SPIFFS.exists("/calibration.json"))
      |          ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:889:23: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
  889 |     File configFile = SPIFFS.open("/calibration.json", "r");
      |                       ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino: In function 'void save_calibration()':
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:923:23: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
  923 |     File configFile = SPIFFS.open("/calibration.json", "w");
      |                       ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino: In function 'void saveConfig()':
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:953:23: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
  953 |     File configFile = SPIFFS.open("/config.json", "w");
      |                       ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino: In function 'void setup()':
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:1117:9: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
 1117 |     if (SPIFFS.begin())
      |         ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:1120:13: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
 1120 |         if (SPIFFS.exists("/config.json")) {
      |             ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:1123:31: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
 1123 |             File configFile = SPIFFS.open("/config.json", "r");
      |                               ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino: In function 'void factoryReset()':
/Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:1516:13: warning: 'SPIFFS' is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
 1516 |             SPIFFS.format();
      |             ^~~~~~
In file included from /Users/andypiper/Development/third-party/anavi-thermometer-sw/anavi-thermometer-sw/anavi-thermometer-sw.ino:2:
/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/FS.h:275:15: note: declared here
  275 | extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
      |               ^~~~~~

These are only warnings, but it looks like LittleFS is the way to go for future compatibility.

Temperature reading drops to 0C/32F after period of time

Creating a new issue for this apparent bug.

Has the bug [been fixed] where over a long period
of time, the temperature reading goes
to 32 degrees (F), and stays there?

Originally posted by @MarkKociscin in #47 (comment)

I believe I saw this happen where the temperature display became 0C overnight, one time. Simply restarting the board resolved the issue. I need to do more monitoring (possibly will track MQTT messages to try to pinpoint a consistent period of time).

I guess this could be some kind of memory issue, or possibly a bug with the sensor module itself? Will keep an eye on it.

Unable to compile in Arduino IDE 2.0, error 13

Trying to compile this in Arduino IDE 2.0 is reporting:

Compilation error: Error: 13 INTERNAL: exit status 1

I set the compilation messages to verbose, and see:

Using board 'generic' from platform in folder: /Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2
Using core 'esp8266' from platform in folder: /Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2
Detecting libraries used...
/Users/andypiper/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/lwip2/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/libc/xtensa-lx106-elf/include -I/private/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino-sketch-61C39F221C08F1DF8BAEF1771E5B7836/core -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10607 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_GENERIC\"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/variants/generic /private/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino-sketch-61C39F221C08F1DF8BAEF1771E5B7836/sketch/anavi-thermometer-sw.ino.cpp -o /dev/null
Alternatives for ESP8266WiFi.h: [[email protected]]
ResolveLibrary(ESP8266WiFi.h)
  -> candidates: [[email protected]]
/Users/andypiper/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/lwip2/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/libc/xtensa-lx106-elf/include -I/private/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino-sketch-61C39F221C08F1DF8BAEF1771E5B7836/core -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10607 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_GENERIC\"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/variants/generic -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi/src /private/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino-sketch-61C39F221C08F1DF8BAEF1771E5B7836/sketch/anavi-thermometer-sw.ino.cpp -o /dev/null
Alternatives for ESP8266httpUpdate.h: [[email protected]]
ResolveLibrary(ESP8266httpUpdate.h)
  -> candidates: [[email protected]]
/Users/andypiper/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/lwip2/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/libc/xtensa-lx106-elf/include -I/private/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino-sketch-61C39F221C08F1DF8BAEF1771E5B7836/core -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10607 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_GENERIC\"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/variants/generic -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266httpUpdate/src /private/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino-sketch-61C39F221C08F1DF8BAEF1771E5B7836/sketch/anavi-thermometer-sw.ino.cpp -o /dev/null
Alternatives for ESP8266HTTPClient.h: [[email protected]]
ResolveLibrary(ESP8266HTTPClient.h)
  -> candidates: [[email protected]]
/Users/andypiper/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/lwip2/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/libc/xtensa-lx106-elf/include -I/private/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino-sketch-61C39F221C08F1DF8BAEF1771E5B7836/core -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10607 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_GENERIC\"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/variants/generic -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266httpUpdate/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266HTTPClient/src /private/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino-sketch-61C39F221C08F1DF8BAEF1771E5B7836/sketch/anavi-thermometer-sw.ino.cpp -o /dev/null
Alternatives for DNSServer.h: [[email protected]]
ResolveLibrary(DNSServer.h)
  -> candidates: [[email protected]]
/Users/andypiper/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/lwip2/include -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/libc/xtensa-lx106-elf/include -I/private/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino-sketch-61C39F221C08F1DF8BAEF1771E5B7836/core -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10607 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_GENERIC\"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266 -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/variants/generic -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266httpUpdate/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266HTTPClient/src -I/Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/DNSServer/src /private/var/folders/3t/s2qs3f713zvgvt7kq31rkrxc0000gn/T/arduino-sketch-61C39F221C08F1DF8BAEF1771E5B7836/sketch/anavi-thermometer-sw.ino.cpp -o /dev/null
Alternatives for NTPClient.h: []
ResolveLibrary(NTPClient.h)
  -> candidates: []
Using library ESP8266WiFi at version 1.0 in folder: /Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi 
Using library ESP8266httpUpdate at version 1.3 in folder: /Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266httpUpdate 
Using library ESP8266HTTPClient at version 1.2 in folder: /Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266HTTPClient 
Using library DNSServer at version 1.1.1 in folder: /Users/andypiper/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/DNSServer 
Compilation error: Error: 13 INTERNAL: exit status 1

Better handling of unavailable values

Currently, the ANAVI Thermometer publishes all measurements using MQTT with the retain flag set. I'm not sure that is a good idea. If a Thermometer crashes or loses power, the MQTT broker will continue to publish the last seen value, and it might not be obvious at first if a value is stable or stale.

Perhaps it should even publish a will topic so and configure a availability_topic in the MQTT Discovery message, so that Home Assistant can detect when the sensor goes away.

I hope to be able to play with these ideas in the near future and might be able to issue a pull request next week, if things work out. Feedback welcome if somebody has any ideas regardging this.

MQTT server is not saved persistently

I got my thermometers the other day. Setup was easy. I used my own MQTT server,
and things just worked as long as the thermometer was powered up. But after removing
power and re-applying it, I received no updates at the MQTT server. Sniffing the network
I discovered that the updates were sent to iot.eclipse.org instead of my server.

The thermometer does remember which WiFi network to connect to, and the WiFi
password, but apparently not the MQTT server name.

As a workaround I've edited the source code and changed mqtt_server to the server
I want to use, and re-flashed the thermometer. Now it seems to work. But I was under
the impression that I shouldn't need to do that.

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.