-
Notifications
You must be signed in to change notification settings - Fork 53
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
Megadesk recalibration throws error #134
Comments
Recalibration i.e. is needed when the two legs of the table are not moving in sync anymore, meaning, one leg reaches the lower or upper end earlier than the other. |
Are you using a ESP32 on 3.3 Volt? I'm asking, as I also from time to time have issues with megadesk and/or the ESP board crashing. Greg pointed out that the signaling voltage of Megadesk is 5V which I guess is the root cause for the crashes I experience (meaning the problem is not the megadesk). Greg suggested to use a Voltage Level Shifter to make sure both boards are operating on 5V. |
Can you remove your serial connection (TX,RX,GND) to megadesk and attempt the recalibration procedure to see if it works? |
96 is too low. It's probably via these lines megadesk/code/src/megadesk.cpp Lines 767 to 773 in 523fab1
We could change this to look at the direction of movement to error out accordingly. Eg if we are too-low for some reason, it could still allow UP movement. |
So basically if it throws me a DE****,*** error, I need to recalibrate. Will this happen often?
I am using https://www.ezsbc.com/product/wifi01-sw/ as recommended on the site and haven't had any issues for a month now except the recalibration procedure. Does this thing need it? It is taking power from the same 24v source.
It would be a pain to start recalibration, since I didn't open the original enclosure and don't have any buttons attached to megadesk. But I might connect some other button if it is really needed and there is such option. How the recalibration should work, btw? Once megadesk lowers the desk, the recalibration is completed right away, and it should answer via serial?
But that wouldn't explain why it becomes unresponsive upon recalibration, right, not even giving me E96 error until I restart it? |
Correct, that is an odd one. I don't personally use serial control. But with just hardware, after recalibration, it will respond immediately. Are you equipped to flash your megadesk with firmware? |
I have FT232R (3.3v for logic) and CP2102 5v. I guess I should use the latter. It's been a while since I done it, but with some instructions I can do it. |
You'll need an AVRISP to re-flash it, not a serial converter. A Pi will work as well in a pinch. |
Oh, right, I forgot I probably used RPi for that. I got RPi3. |
In that case, if you are comfortable with it, you could flash some custom firmware that has different limits for the absolute min/max heights. If you are comfortable with As for the AVR flashing itself yvia the Pi, you will need to rely on existing materials on the internet. I won't be able to assist much. ( https://github.com/gcormier/avr5hat/blob/main/code/pi_program.sh maybe be useful to you ) |
That would be best. I will need to use a 3.3v-5v logic level shifter or what? |
No, you can run megadesk at 3.3V and flash it. So just use the 3.3V from the Pi, MOSI/MISO and GND. |
megadesk-firmware-2023-04-23.zip Here's a firmware you can try. It should allow you to move UP even if you are bottom'd out, or move down if you are at the very top. This won't address the serial timeouts, but perhaps at least fix the other issue of being unable to move the desk ? |
Need some help with flashing before I brick something. I connected it all like this: https://www.rototron.info/wp-content/uploads/PiSPI01.jpg Added this to avrdude.conf:
Did "sudo /usr/bin/avrdude -p t841 -c linuxgpio -v -t" and got "avrdude: AVR device initialized and ready to accept instructions". So it looks like the connections are fine. Modified pi_program.sh:
Can I run it? Or what else do I need? |
You can remove the fuses since they will already be set properly. Fuses
would be the biggest risk when flashing.
…On Tue, Apr 25, 2023, 5:29 PM buran-energia ***@***.***> wrote:
Need some help with flashing before I brick something.
I connected it all like this:
https://www.rototron.info/wp-content/uploads/PiSPI01.jpg
Added this to avrdude.conf:
programmer
id = "linuxgpio";
desc = "Use the Linux sysfs interface to bitbang GPIO lines";
type = "linuxgpio";
reset = 12;
sck = 11;
mosi = 10;
miso = 9;
;
Did "sudo /usr/bin/avrdude -p t841 -c linuxgpio -v -t" and got "avrdude:
AVR device initialized and ready to accept instructions". So it looks like
the connections are fine.
Modified pi_program.sh:
#!/bin/bash
firmware=megadesk-limit_fix-t841-serial.hex
DEVICE=t841
LOW_FUSE=0xE2
HIGH_FUSE=0xD6
EXT_FUSE=0xFE
sudo avrdude -p $DEVICE -B 250khz -D -v -U hfuse:w:$HIGH_FUSE:m -U lfuse:w:$LOW_FUSE:m -U efuse:w:$EXT_FUSE:m #2>/dev/null
sudo avrdude -p $DEVICE -B 1MHz -v -U flash:w:$firmware:i #2>/dev/null
Can I run it? Or what else do I need?
—
Reply to this email directly, view it on GitHub
<#134 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACAAC5YYNJK4M2MZH4YJF63XDA64FANCNFSM6AAAAAAXBGRLN4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
(ignore the last 2 posts that I deleted, I issued wrong cmds). Recalibration seems to work now. I flashed it, did "L,14.", it lowered the desk and didn't even hang. |
So I just dug through some more of the code, and the edge case was already accounted for megadesk/code/src/megadesk.cpp Lines 754 to 765 in 523fab1
So it is weird that with stock firmware, you were not able to "escape" out of the lower limit. |
I don't even think it's possible, but I would be curious if you re-flashed the stock serial firmware if you have any issues. I verify the firmware after flashing all the units, so it should technically be impossible to have a "bad flash". |
The code you linked seems to be related to manual move up and down, right? I don't have any up/down buttons connected to it and only control it using serial, remember? So after calibration, it would hang and after restart it would give me E96 error even for commands such as "C0,0" (get position). That was the problem. |
I did recalibration again, it lowered the desk to minimum, and this time it hanged (no serial responses). But I repluged power, and I don't get the E96 error anymore with this fix and was able to move the desk with serial. So the new flash seems to have somewhat fixed my initial problem. edit: did recal again, didn't hang. The worst type of bugs. |
So hmm a new issue. Any idea why with this fix it sometimes lowers the table a bit upon pluging power? E.g. I plug the desk power, and the table goes down from 500 to 160 position for no reason. Any idea why it would move on its own now? |
There might be some issues with the legs/motors. Already the recalibration should not be going as low as it is. You could try to use the MIN limit functionality to set the lower limit to be a bit higher the the absolute minimum to solve the issue. |
And a new one. It seems to have stopped remembering the positions I saved after the power is lost. E.g., I save positions using "<S500,2." and "<S1000,3.". Then unplug it for a few minutes, plug it back and I get a sad tone when trying to move to them. This wasn't a problem before flashing. |
So basically once you cut desk power for a bit and plug it in, it always lowers the desk to minimum position for no reason by itself. And it doesn't seem to remember anything from the eeprom (e.g. <"R,2." will read zero despite there being a saved position before replugging).
There's some bigger issues. But if you mean setting the lowest limit using "L,11", it didn't work due to the eeprom issue I guess. I set it to 560 (verified using R.11.). Then after replugging power it reads 299. |
I'm still wondering if there's some serial hiccups at the start. Can you
unhook the serial control to see if that behaviour happens when powering on?
…On Tue, Apr 25, 2023, 9:01 PM buran-energia ***@***.***> wrote:
So basically once you cut desk power for a bit and plug it in, it always
lowers the desk to minimum position for no reason by itself. And it doesn't
seem to remember anything from the eeprom (e.g. <"R,2." will read zero
despite there being a saved position before replugging).
You could try to use the MIN limit functionality to set the lower limit
There's some bigger issues. But if you mean setting the lowest limit using
"L,11", it didn't work due to the eeprom issue I guess. I set it to 560
(verified using R.11.). Then after replugging power it reads 299.
—
Reply to this email directly, view it on GitHub
<#134 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACAAC53QEF6CPAPOZTLX44TXDBXWTANCNFSM6AAAAAAXBGRLN4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I unplugged all cables going to ESP32. Still lowered the desk by itself upon getting power. |
Can you reach out to me via Tindie? Maybe there's a hardware issue.
…On Tue, Apr 25, 2023, 9:23 PM buran-energia ***@***.***> wrote:
Can you unhook the serial control to see if that behaviour happens when
powering on?
I unplugged all cables going to ESP32. Still lowered the desk by itself
upon getting power.
—
Reply to this email directly, view it on GitHub
<#134 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACAAC5YREGRGCBWBZ6AQT23XDB2K3ANCNFSM6AAAAAAXBGRLN4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Flashed megadesk-v2022.09-t841-serial.hex. It doesn't move the table on startup, but still doesn't remember positions. |
Faulty hardware |
Megadesk hangs and then throws error when I try to recalibrate using it. Megadesk is controlled via Serial using ESP32 (24V).
Since I can only control it via Serial, I am sending the command "<L,14.", which should be equal to "14 UP pushes" that launches a recalibration procedure. When I do this, the desk goes down to the lowest position, but then Megadesk does not respond to any Serial commands. This isn't normal, right? Then upon switching power, it gives me ">E96,0" error no matter the command I send (e.g. "<C,0."). What does this error even mean? I can bring the desk back to life by using the original controller and moving the desk a bit up, then changing back to Megadesk, but I prefer for recalibration to work via Megadesk.
Also I couldn't find anywhere in the docs: when do you need to recalibrate the motors? I assume it is when you get an error such as "DE4732,117" and the desk doesn't move to the correct preset position.
Other than the above issues, everything works.
The text was updated successfully, but these errors were encountered: