Error on flashing the firmware
If you get an error on the firmware installation process, you should see a View logs button. Click it to open the logs in a log viewer.
You can also view the logs manually by opening /tmp/lunar-sensor-install.log
in any text editor.
If you don't understand the error from the logs, you can upload them on Lunar's Discord community and I'll take a look.
If you understand the error, you may try to tweak the firmware:
- Open a Terminal
- Copy the firmware files in a separate folder:
mkdir -p ~/lunarsensor && cd ~/lunarsensor
cp /Applications/Lunar.app/Contents/Resources/{lunar.yaml,install.sh,tsl2591.h} ~/lunarsensor/
- Open
lunar.yaml
in a text editor and tweak it for your own board
- Manually flash the firmware
WIFI_SSID="your wifi name" WIFI_PASSWORD="your wifi password" ESP_DEVICE="your esp32/esp8266 device path or host" BOARD="your esp32/esp8266 board type" ./install.sh
Example:
WIFI_SSID="PrettyFly" WIFI_PASSWORD="for a wifi" ESP_DEVICE="/dev/cu.usbserial-110" BOARD="esp32dev" ./install.sh
Lunar doesn't detect the sensor
First check if the sensor booted and connected to the local network:
- If the ESP32/ESP8266 board has flashing lights, that means the board is booted and running firmware code (although we can't say for sure if it's the correct code)
- Open a Terminal and try to ping the sensor
- Run the following command:
ping lunarsensor.local
- If you see lines like
64 bytes from 192.168.1.237
then the device is connected to your WiFi
- Otherwise, it's possible that the WiFi credentials were incorrectly written
- Try the firmware installation again and pay close attention to the network name and password inputs
- If the device can be pinged, check the sensor output
Run the following command and wait about 10 seconds
curl -N lunarsensor.local/events
You should start seeing lines like the following:
data: {"id":"sensor-ambient_light_tsl2561","state":"0.1 lx","value":0.0912}
If instead you don't get any output or see a lot of NaN
values like:
data: {"id":"sensor-ambient_light_tsl2591","state":"nan","value":NaN}
- It is possible that the TSL25x1 sensor is not connected correctly (or even faulty)
- Take a look at the Assembly instructions again and try to redo the wire connections