-
Notifications
You must be signed in to change notification settings - Fork 13
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
Bad arg length error when other devices request DHCP during stage 1 #2
Comments
Thanks for that |
Thanks SynAckFin for all the great work! I ran into the same error flashing a Teckin SP20 plug. First plug flashed without issue, while the second encountered the Bad arg length error. I reran a few times and it eventually bricked the plug. As stated by bkpsu, the mac address in the log below belongs to another device on my network and not the SP20 plug. What do you think is the best way to avoid other devices sending a dhcp request and causing the script to error out? I have an old router that I can setup just for the raspberry pi and the target device to be flash. ... |
@axiom00 - are you sure the plug was bricked? In my case, I did end up getting the two ..."e":false,"success":true... statements, and was able to continue with stage 2. It might be worth running the script again with the "-b 2" option just to see if it works... Also, good idea for a workaround (using a dedicated router/guest SSID)! |
@bkpsu - I am 90% sure it was bricked. After running the script a few times without -ip, the script wasn't able to detect the plug and my router no longer show the leased ip. Pressing the button did not activate the LED or relay. I also tried factory resetting it by holding down the button for 5 seconds, but nothing happened. Unfortunately I returned the plug today so I can't try your suggestion. |
@axiom00 Hopefully I've fixed the DHCP issue. |
@SynAckFin I tried the updated script to fix the DHCP issue and still getting the error. I am weary to run it with the -ip and bricking. Any thoughts? $ sudo ./tuyota.pl |
Think I've found what the problem was. |
When the script is running through stage 1 (DHCP Discovery), if other devices send DHCP requests at the same time, the script sometimes fails with the following error:
"
DHCP Discover cc:50:e3:d5:90:fd 10.44.57.19
DHCP Discover cc:50:e3:d5:90:fd 10.44.57.19
DHCP Request cc:50:e3:d5:90:fd 10.44.57.19
DHCP Discover a0:20:a6:0d:e1:bd
Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at /usr/lib/arm-linux-gnueabihf/perl/5.24/Socket.pm line 157, <$fh> line 28.
Exiting....
Shutting down...
"
In this case, device with the MAC cc:50:e3:d5:90:fd is the target device (ZOOZEE SA101 plug), while a0:20:a6:0d:e1:bd is another ESP sensor (waking up from deepsleep). Stage 1 did complete, and I was able to continue with stage 2 and complete the flash satisfactorily!
The text was updated successfully, but these errors were encountered: