All Projects → Torxgewinde → Desk Lamp Alternative Firmware

Torxgewinde / Desk Lamp Alternative Firmware

Licence: gpl-2.0
An alternative firmware for the Mijia Xiaomi Desk Lamp

Projects that are alternatives of or similar to Desk Lamp Alternative Firmware

Esp3d
FW for ESP8266/ESP8285/ESP32 used with 3D printer
Stars: ✭ 979 (+1712.96%)
Mutual labels:  arduino, firmware, esp8266, wifi
Open Desk Lamp Firmware
Open source firmware for the xiaomi desk lamp
Stars: ✭ 78 (+44.44%)
Mutual labels:  xiaomi, lamp, firmware, esp8266
Bleeper
Library to manage your firmware configurations written in C++
Stars: ✭ 54 (+0%)
Mutual labels:  arduino, firmware, esp8266, wifi
Esp32marauder
A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32
Stars: ✭ 233 (+331.48%)
Mutual labels:  arduino, firmware, esp8266, wifi
SuperLEDstrip
No description or website provided.
Stars: ✭ 13 (-75.93%)
Mutual labels:  esp8266, firmware, led
Esp8266 Bitcoin Ssid Ticker
A Bitcoin SSID ticker for ESP8266's written in Arduino C/C++
Stars: ✭ 31 (-42.59%)
Mutual labels:  arduino, esp8266, wifi
Esphelper
A library to make using WiFi & MQTT on the ESP8266 easy.
Stars: ✭ 310 (+474.07%)
Mutual labels:  arduino, esp8266, wifi
Heatpump
Arduino library to control Mitsubishi Heat Pumps via connector cn105
Stars: ✭ 327 (+505.56%)
Mutual labels:  arduino, esp8266, wifi
Esp Mqtt Json Multisensor
(OBSOLETE) ESP MQTT JSON Multisensor for Home Assistant. Supported sensors include the TEMT6000 light, AM312 PIR, DHT22 temperature/humidity sensors. RGB led supports flash, fade, and transition. Over-The-Air (OTA) uploading, too!
Stars: ✭ 323 (+498.15%)
Mutual labels:  led, esp8266, wifi
Sonoff Homeassistant
Firmware for ESP8266 based itead Sonoff switches for use with HomeAssistant
Stars: ✭ 354 (+555.56%)
Mutual labels:  arduino, firmware, esp8266
Esp Mqtt Json Digital Leds
(OBSOLETE) ESP8266 MQTT JSON Digital LEDs for Home Assistant
Stars: ✭ 503 (+831.48%)
Mutual labels:  arduino, led, esp8266
Catchme
CatchME - WiFi Fun Box "Having Fun with ESP8266"
Stars: ✭ 28 (-48.15%)
Mutual labels:  arduino, esp8266, wifi
Spore
Spore WiFi LED module. Firmware and Hardware.
Stars: ✭ 19 (-64.81%)
Mutual labels:  esp8266, wifi, led
Blynk Library
Blynk library for embedded hardware. Works with Arduino, ESP8266, Raspberry Pi, Intel Edison/Galileo, LinkIt ONE, Particle Core/Photon, Energia, ARM mbed, etc.
Stars: ✭ 3,305 (+6020.37%)
Mutual labels:  arduino, esp8266, wifi
Openmqttgateway
MQTT gateway for ESP8266, ESP32, Sonoff RF Bridge or Arduino with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility, SMS & LORA.
Stars: ✭ 2,413 (+4368.52%)
Mutual labels:  xiaomi, arduino, esp8266
Deauthdetector
Detect deauthentication frames using an ESP8266
Stars: ✭ 406 (+651.85%)
Mutual labels:  arduino, esp8266, wifi
Mqtt via esp01
TCP/UDP Applicaton for UNO/MEGA/STM32 using ESP8266's AT firmware.
Stars: ✭ 23 (-57.41%)
Mutual labels:  arduino, esp8266, wifi
Esp8266 Wifi Relay
simple sketch of using ESP8266WebServer to switch relays on GPIO pins. It serves a simple website with toggle buttons for each relay
Stars: ✭ 13 (-75.93%)
Mutual labels:  arduino, esp8266, wifi
Tasmota
Alternative firmware for ESP8266 with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
Stars: ✭ 16,624 (+30685.19%)
Mutual labels:  arduino, firmware, esp8266
Esp8266 artnetnode v2
ESP8266 based WiFi ArtNet to DMX, RDM and LED Pixels
Stars: ✭ 400 (+640.74%)
Mutual labels:  arduino, led, esp8266

Desk-Lamp-Alternative-Firmware

An alternative firmware for the Mijia Xiaomi Desk Lamp Build Status

Inspiration

After finding fvollmers project, it was possible to create this firmware. Thanks for the inspiration and the helpful details like GPIOs and pinouts.

Features

  • This alternative firmware compiles with the Arduino IDE.
  • It provides a webserver and URLs for controlling the light.
  • The rotary knob reacts on single click and toggles between OFF and ON
  • Per default after flashing the firmware WiFi is OFF
  • Per default the lamp has WiFi switched off. Double-clicking the knob twice within two seconds toggles WiFi ON and OFF

Initial upload of firmware

The initial upload requires the following steps:

  1. Open the desk lamp. Three screws are hidden underneath the rubber. Slightly peel away the rubber and unfasten the screws.
  2. Then look for the PCB-A located below the rotary knob, it carries the ESP8266 module. Unfasten the screws of that PCB-A, pull off the knob gently and turn the PCB-A around. To protect the knob, I wrapped some electrical tape around it to prevent scratches and used pliers to pull it upwards, away from the PCB-A.
  3. Solder cables to RX, TX and GPIO0. GND is also required for programming, but depending on your programming cable this signal is easily accessible even when the PCB is put back in place. Soldering to the ESP8266 module will result in fragile connections. Because of that, I decided to provide cable support afterwards by applying hot-melt-glue, otherwise the connections would not last long when handled. A labeled picture certainly helps.
  4. Put back the PCB-A, fasten the screws.
  5. Attach a 3.3V USB to serial adapter cable. Connect cables GND to GND, cables Tx to Rx and cables Rx to Tx. If you want to check correct wiring, power up the lamp and use the serial-monitor for any activity. Most likely it will just print gibberish due to mismatched baudrate, but this is enough to see Rx and Tx should be wired correctly; if there is no activity when powering the lamp try swapping the Rx and Tx lines.
  6. Connect GPIO0 to GND. Keep it pulled low until firmware has uploaded from the Arduino IDE.
  7. Compile the firmware and upload from within the Arduino IDE.
  8. Unconnect GPIO0 from GND, power-cycle the lamp and it should dim-up. The serial monitor should inform you about the startup (115200, 8N1).

Flashing updates via WiFi

Once the firmware has uploaded initially, you can reupload through WiFi using the BASH script (assuming the desk-lamp got the IP adress 192.168.2.99):

# ./flash.sh 192.168.2.99

The stdout-messages should look as follows:

./flash.sh 192.168.2.99
enableUpdates: 1
<META http-equiv="refresh" content="15;URL=/">Update Success! Rebooting...

Monitoring log-messages

To monitor the log messages, use the log.sh BASH script. It refreshes the log messages every second.

./log.sh 192.168.22.99

Upload files for the webserver

The internal webserver serves files from device-internal-flash-filesystem. To fill the internal flash-filesystem, the most convenient way is creating a subfolder data in the sketch-folder and upload with the provided BASH-file upload.sh.

Uploading all files from ./data to flash-filesystem:

./upload_files.sh 192.168.2.99

Upload a single file file to flash-filesystem:

./upload_files.sh 192.168.2.99 myfile 

Web-API

To send commands to the desk lamp or read the state, the following HTTP-handlers are implemented:

  • Set color to 100% warmwhite: http://192.168.2.99/color?ratio=1.0&brightness=1.0
  • Set color to 100% coldwhite: http://192.168.2.99/color?ratio=0.0&brightness=1.0
  • Set color to 25% coldwhite and 25% warmwhite: http://192.168.2.99/color?ratio=0.5&brightness=0.5
  • Set color to 30% coldwhite and 30% warmwhite: http://192.168.5.18/split?cold=0.3&warm=0.3
  • Get color as JSON: http://192.168.2.99/color
  • Get current state as JSON: http://192.168.2.99/all
  • Get log messages: http://192.168.2.99/log
  • Reset / Restart the lamp: http://192.168.2.99/reset
  • Retrieve the config as JSON (does not expose the WiFi credentials): http://192.168.2.99/config.json
  • There are more URLs to flash the firmware and upload files for the webserver (namely: unlock, edit, format, update). To prevent unauthorized flashing of (malicious) firmware or webserver files at least a hardcoded password is required. If you worry about this password change it in the sourcedode and notice that HTTP does not encrypt it.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].