New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I use the serial commands? #58
Comments
Here is where I described the command structure The commands are mostly binary, with ASCII command indicators. For initial testing I was using Termite with the "Hex View" plugin. |
Thanks, Ik will look into that... |
With #70 there's the option of enabling pure ascii commands/responses. No need to read/write raw bytes over serial to control.
After the marker byte '<', there's the Command byte, then two fields of ascii integer digits.
|
Hello, Finally found time to implement the serial commands. I flashed the latest firmware with the serial commands enabled and connected a esp8266 to the serial port. I loaded the following ESPHOME code onto the ESP and now I can control my Ikea desk from Home Assistant and through Google Home (Ok Google activate standing/sitting/middle)
This code automatically gives me 3 switches within HA. Gr. Remco |
Wow, that's awesome that it was so easy with esphome! Nice work! |
Only to bad, the power regulators of the megadesk can only deliver 5V/500mA. Now I need an additional powersupply to feed the ESP. Maybe in a new version you can upgrade the regulators to 1A or 1.5A types (they have same package I think). And maybe add an extra sideways connector with RX,TX,5V and GND. The current header cannot have a paring connector due to the height of the housing. Keep up your great work... Remco |
The issue is not the part itself, but the thermal limitations of a linear regulator in a small space. https://www.gadgetronicx.com/calculators/linear-regulator-power-dissipation-calculator/ It is best to tap the 24V(30V) independently to power the secondary MCU with an independent regulator, DC BUCK or linear. |
Maybe it helps if you cascade the 7812 and the 7805 to lower the voltagedrop, but the 7812 then needs to deliver more power, still a lot of heat dissipation. Thanks. |
At the end of the day there is still around 7-13W of power to dissipate. A buck would be best for sure :) |
@rhannink have you documented this in more detail anywhere? Thanks |
Hello @benfysh, I did not find the time to document this project on GitHub. What I did was:
Now you have 3 switches available in HA for 3 different presets (I have 3 presets programmed in the megadesk controller 1-low, 2-high and 3-in between). |
I wrote a blog post about it, maybe it helps: https://tobru.ch/ikea-bekant-table-control-over-mqtt-with-megadesk-and-esp32/ |
@benfysh , indeed it is very cool, once it is hooked up to HA you can also control it with Google Home. "Ok Google I want to standup", "Ok Google, I want to sit down". |
Gonna add a todo to bring out some info in the docs so people don't have to dig in issues for the commands. |
Added serial/esphome documentation to bottom of readme. |
Hello,
First off all, great product, works like a charm, but I would like to connect it to my domotic system (HA) and Google system.
I recompiled the code with the #define SERIALCOMMS.
I flashed the firmware with a pocket AVR programmer and this all works fine.
When I connect an FDTI232 to the pins MISO and SCK I see the following commands in my terminal when I press the up or down button.
14:51:02.422 -> <+���<+���<+���<+���<+���<+���<+���<+���<=�z�<+���<=�⸮�<+���<=�⸮�<+���<=�⸮�<+���<=�⸮�<+��<=�⸮�<+� �<=�⸮�<-� �<-���<-���<-���<-���<-���<-���<-���<-���<-���<-���<-���<-���<=�⸮�<-���<=�⸮�<-���<=�⸮�<-���<=�{�<-���<=�f�<-��<=�Z�<-� �<=�Q�<-���<=�N�<+���<+���<+���<+���<=�⸮�<+���<=�⸮�<+���<=�⸮�<+���<=�⸮�<+���<=�⸮�<+��<=�⸮�<+� �<=�⸮�<-� �<-���<-���<-���<-���<=�⸮�<-���<=�⸮�<-���<=�o�<-���<=�W�<-���<=�B�<-��<=�6�<-� �<=�-�<-���<=�*�<+���<+���<+���<+���<+���<+���<+���<+���<+���<+���<=�⸮�<+���<=���<+���<=�)�<+���<=�>�<+���<=�P�<+��<=�\�<+� �<=�e�<-� �<-���<-���<-���<-���<-���<=�⸮�<-���<=�⸮�<-���<=�⸮�<-���<=�⸮�<-���<=�⸮�<-��<=�⸮�<-� �<=�⸮�<-���<=�{�<+� �<+��<+���<+���<=�⸮�<+���<=�⸮�<+���<=�⸮�<+���<=�
So that looks ok, but how can I sent a command via a serial terminal program? I tried to sent <- and <+ with or without returns, but nothing happens. What am I missing. Do i need to sent more bytes ? Can I use a serial terminal command line at all to sent commands?
Eventually I would like to use an ESP(8266 or 32) to control the megadesk. Maybe someone has some example code on what command/bytes exactly to sent over the serial line?
Thanks in advance
Remco
The text was updated successfully, but these errors were encountered: