Hi, great project and I appreciate how open things are compared to the usual IoT junk. I'm an embedded developer experienced with Espressif firmware. I'm curious about how the V-Pro Smart line works with a view to potentially modifying the firmware to add local MQTT support (or adding support for the devices to ESPHome).
I have a Varilight V-Pro Smart and I was curious if the firmware is open source for this device? I can't work out from github what build target I would use. I'm also not entirely sure whether Supla or Varilight (using supla) are responsible for firmware development for the "Smart" line.
I've got one in pieces in front of me, and it appears that there is a PIC16F inside which presumably handles the dimming & S-LINK side (as they have a "non-wifi" version as well which I'm assuming (big assumption!) just excludes the WROOM module running the supla firmware).
If I could get the firmware it would save needing to work out the protocol that the WROOM uses to communicate with the PIC (hopefully i2c or UART, but possibly just faking the encoder!)
I've sent an email to Varilight asking them if their firmware is based on supla-espressif-esp (certainly it's possible from the version numbering) and whether they are using it under the terms of the GPL so that as a customer I can request a copy of the source.
I appreciate that this project funding comes from devices and if you would prefer I figure it out I understand - although presumably there's no real value in someone cloning any of these devices given supla is open source anyway.
Firmware source availability for Varilight
-
- Posts: 18907
- Joined: Tue Jan 19, 2016 9:26 am
- Location: Paczków
The firmware for the V-Pro is not publicly available. As you have noticed, there are two chips there and we do not have access to the second one (PIC) apart from UART communication. Most Supla devices have local MQTT. Unfortunately, the V-Pro has not yet had this, mainly because the V-Pro has a rather specific calibration, which would be difficult to implement without a dedicated application. For now, I suggest using the MQTT protocol served by the Supla cloud, where the V-Pro dimmer is available.
-
- Posts: 4
- Joined: Fri Aug 23, 2024 4:24 pm
Thank you for confirming and I understand!
I've found the UART RX/TX connection and captured the commands for most common actions - the protocol seems fairly simple.
I prefer for all my IoT devices to only rely on local services so I'll have a look at setting up a local supla server - I was just hoping to avoid all the overhead of another bridging service (nothing against Supla, it seems excellent compared to most IoT platforms I've seen, but I already use HA).
I think I've got a grasp on everything except for the calibration aspect? Is it the functionality accessible via the cog on the lower right of the android page, that provides the operating range settings, boost, dimming modes & status LED behaviour? Or is there something more complex inside the firmware I've missed.
I can see this functionality in the Varilight instructions pdf but when I try to access it in my android app I get a "Please enter your Supla Cloud login details" dialogue. If I try and log in, I get a "Time exceeded, please try again". The rest of the app functionality seems to work fine and I can log into Supla Cloud on my desktop no problem.
If that's the case, hopefully it's just that the operating range settings are mapped to the dimming brightness command (0x43?) as the final byte in the message that defaults to 0x00 to 0x64 (compressing the range as necessary), but I haven't traced startup yet so possibly there's some additional instructions that need to be sent to the PIC.
Anyway, thank you for your patience & quick reply previously and if you can't reply to this I understand completely!
I've found the UART RX/TX connection and captured the commands for most common actions - the protocol seems fairly simple.
I prefer for all my IoT devices to only rely on local services so I'll have a look at setting up a local supla server - I was just hoping to avoid all the overhead of another bridging service (nothing against Supla, it seems excellent compared to most IoT platforms I've seen, but I already use HA).
I think I've got a grasp on everything except for the calibration aspect? Is it the functionality accessible via the cog on the lower right of the android page, that provides the operating range settings, boost, dimming modes & status LED behaviour? Or is there something more complex inside the firmware I've missed.
I can see this functionality in the Varilight instructions pdf but when I try to access it in my android app I get a "Please enter your Supla Cloud login details" dialogue. If I try and log in, I get a "Time exceeded, please try again". The rest of the app functionality seems to work fine and I can log into Supla Cloud on my desktop no problem.
If that's the case, hopefully it's just that the operating range settings are mapped to the dimming brightness command (0x43?) as the final byte in the message that defaults to 0x00 to 0x64 (compressing the range as necessary), but I haven't traced startup yet so possibly there's some additional instructions that need to be sent to the PIC.
Anyway, thank you for your patience & quick reply previously and if you can't reply to this I understand completely!
-
- Posts: 4
- Joined: Fri Aug 23, 2024 4:24 pm
I've found the relevant sections (VLCalibrationTool/VLCfgParams) in the android application and understand now that there's calibration/settings messages getting sent to the PIC. The code for both the android app & supla core is extremely clean and readable by the way!
-
- Posts: 18907
- Joined: Tue Jan 19, 2016 9:26 am
- Location: Paczków
Unfortunately, I cannot provide any signatures in this regard for natural reasons (I am not authorized), however, as you have already noticed, a lot can be read from the code, and the rest can be "eavesdropped" on from the UART
-
- Posts: 4
- Joined: Fri Aug 23, 2024 4:24 pm
Absolutely understand, no problem!
Do you know why I am unable to access the calibration section for my dimmer in the android app? When I click on the settings cog I get a login dialogue, and if I enter my credentials (I've checked they are correct, they work on supla cloud and the app) it eventually fails with "Timed out waiting for result". I've tried removing and re-adding the dimmer.
Do you know why I am unable to access the calibration section for my dimmer in the android app? When I click on the settings cog I get a login dialogue, and if I enter my credentials (I've checked they are correct, they work on supla cloud and the app) it eventually fails with "Timed out waiting for result". I've tried removing and re-adding the dimmer.
-
- Posts: 18907
- Joined: Tue Jan 19, 2016 9:26 am
- Location: Paczków
Are you using the latest version of the application?