Yep in particular needs to be an Arduino sketch for an ESP8266. If your is, can I get a copy of the code. I need to see why some will work and some won’t. I have tried everything here, on both MAC and WIN and neither will update any OTA ESP8266 based device who says their device is OTA compatible. In fact I can even update the standard example code for OTA that comes with the IDE. It’s frustrating because I’d like to incorporate it in some of the stuff I do.
Yep so the basic setup for OTA. Well it has to be my environment because I cannot get it to work here. As I said, I’v tried firmware from a few different people who say it supports OTA and it just don’t work. Now if that is the case for me it must also happen to others. That’s why I find OTA flaky at best.
BTW is that a NodeMCU based board because it does work on them. I believe they use ESP-12’s
My first thought would be firewall maybe.
Do you have another device you can try to OTA from? That would give you a more definitive answer to if its you machine.
Make sure your arduino is upto date ect.
If no OTA scripts work at all it might be worth asking on the esp8266 arduino forums.
@aneisch: The support for RGBW is planned for April.
@KmanOz: I’ve included the code for OTA updates, but I didn’t have mentioned it as a feature. I’m also unable to update the firmware Over-The-Air (Mac, is working for my NodeMCUs 1.0).
Well it seems I have it going on my Sonoff Code but only on the Mac. Same ver of IDE & Python on both yet only 1 works. It’s very unpredictable to be honest.
EDIT: For anyone having issues with OTA, my Windows machine thought it was connected to a Public Network for some reason and the firewall was blocking the port. Once I changed it to Private Network, OTA just worked fine.
I’ve been playing with this again today, and had an idea to buy several units and then group all of them in HA for control. The problem is, however, if I establish all of my units into a HA group, I am just given a single on/off switch, I loose the small bulb icon that exposes the colour and brightness sub-menu.
Does anyone know, please, if here is any way to set up multiple units up so that I can control brightness and colour on them simultaneously?
Thanks in advance.
EDIT: I had imagined I would set up each light with its own mqtt state and command topics thereby giving them all their own identity. I since been wondering - if I use the Arduino sketch as-is, and don’t edit it for each light, will they then be all pub/sub to the same topic, but I’m guessing this will lead to conflicts in mqtt when 6 lights are all simultaneously publishing states.
Hi,
If you’re using a local MQTT broker, TLS is for me, not mandatory. On the other hand, if you’re using a public MQTT broker, it’s recommended to use SSL/TLS because your credentials are sent in plain text (message MQTT CONNECT).
I think that it’s better to configure each light individually and to create another light (optimistic: false) to control all the lights at the same time. In the sketch, you need to add the code to subscribe to the group topics (see below) and the necessary code to handle these topics (callback method).
Light 1 - X (MQTT topics):
State:
State: arilux/1/state/state
Command: arilux/1/state/set
Brightness:
State: arilux/1/brightness/state
Command: arilux/1/brightness/set
Color:
State: arilux/1/color/state
Command: arilux/1/color/set
Group of lights 1 - X (optimistic mode: true):
State:
Hi, I spent a few hours to make OTA work for this little gadget… and succeeed. Now, I am able to upload my code anytime. My controller arrived a few days ago, ordered from Banggood recently. I have noticed that they have changed the ESP8266 module version. The original post mentions ESP-12F but mine has ESP-12S. It’s a newer model with different flash layout/size - at least that was my idea. I need to say I’m NOT using Arduino IDE but PlatformIO to develop and upload stuff for my ESP modules, but I don’t think it is really matters. So, I used ‘CheckFlashConfig.ino’ (from Arduino/ESP8266 examples) to see what real size of flash do I have and it said it’s 1M not 512K and it reported ‘Flash chip configuration wrong’ error. AFAIK it means my new codes didn’t fit into the OTA when I tried it. Anyway, I quickly uploaded "BasicOTA.ino’ to confirm manual OTA uploads with espota.py and it worked. So I flashed this firmware for Arilux by mertenats (thanks!!!) and tried OTA on that again. All good.
note: esp8266.flash.1m64.ld means 1M (64K SPIFFS) flash size
Hope this helps someone with their OTA issues.
Oh, one more comment. The IR controller didn’t work either. Looks like the vendor includes a different IR remote these days. The codes are different. eg.
@mertenats thank you for your reply. That is 90% clear, but just to check…
Each time I flash a controller (1-x) I will edit and increment both the state and command topics in the sketch so that each controller is effectively unique in MQTT terms.
Each light will be individually configured in HA yaml using its matching pub and sub topics, At this stage I will have 6 configured, working and individually addressable lights.
Correct so far?
Your next bit is my missing 10%! I tried, before posting yesterday, the MQTT concept of “+” to address the lights together, but the configuration was rejected by HA. Are you saying that /group/ is the same thing but the correct syntax in yaml? Is the example you’ve written to be used as-is, or does it require a HA group to be set-up and then that id used instead of /group/?
As an aside, I’ve also had it suggested in another thread that if I change the mqtt_client_id in the sketch (currently set to arilux) to be unique in each controller (the suggestion is to use the 8266 chip code for simplicity) then I can actually use multiple controllers with the same mqtt pub and sub details.
I’ve gone from being frustrated and stuck to having two routes, which is a good result in 24hrs! I’ll explore both…
Hi SethKins,
My solution is just a suggestion and I’ve not tried it yet.
Correct
Correct
Normally, with the MQTT protocol, we can use +and #. As you mentioned, it’s not working. My suggestion is to use a unique command_topic for all the lights, whatever it’s name.
Yes! Each device must have an unique ID.
char MQTT_CLIENT_ID[7] = {0};
...
// get the Chip ID of the ESP and use it as the MQTT client ID
sprintf(MQTT_CLIENT_ID, "%06X", ESP.getChipId());
...
if (mqttClient.connect(MQTT_CLIENT_ID, settings.mqttUser, settings.mqttPassword)) {
...
Apart from a soldering iron will I need anything else? I dont really have any experience with hardware modifications. Do I need a usb to serial converter?
That is the Arilux version of the controller which incorporates IR control as well as wifi. If you don’t plan on using the IR, get the AL-LC01.
Secondly, you won’t need pinheaders to reflash these boards, there are no pin holes to install them. You will have to solder temporary programming wires to pads on the board or use a custom made programming jig with pogo pins or the like.
You only need a usb/serial converter, a soldering iron and four dupont wires to reflash these. I have reflashed four of these, it only took about 15 minutes per board.
I’ve ordered a RGBW lightstrip and I’ll try to convert my RGB controller into a RGBW controller (one free pin unused). However, I don’t know how to proceed with the firmware to handle the white channel.
Use the white channel if the RGB value is equal to 255, 255, 255 and turn off the others
Use the white channel as an independent light (ON/OFF, brightness)
Try to convert RGB into RGBW and vice versa (Home Assistant supports only RGB with the MQTT component)