Asked — Edited
Resolved Resolved by ptp!

Ez-B Automatically Reconnect After Wifi Drop?

Is there a way to set the ez-b to automatically reconnect to wifi after the wifi drops out itself?

For example, im using my 4GLTE hotspot from my phone for internet on my laptop and i have the Ez-b connected in client mode. When a call comes in or i turn the wifi off and then back on, i regain connection to my laptop but i have to cycle the ez-b to get it to reconnect again.

Hopefully this is simple as i plan to use 4GLTE connection primarily with my rover


ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

#1  

It will reconnect after a short disconnect, but after any real length it does need to be power cycled. (not sure what the length of time is, certainly less than a minute).

Alan

#2  

Ive yet to see it reconnect automatically. If i turn my router off and back on, i have to restart the ez-b. This could be really problematic if my robot were in a dark hole somewhere exploring and i lose wifi!

#3  

I wonder if this is something that is in or that DJ could add to the V4 x/2 communication board, or even a function we could flash in the V4 board with the OpenIoT software. I have hte PIKIT tool, I'll dig through the documentation a bit and see if there is anywhere to add a re-try interval.

I know at least one use did a hardware solution using a radio controlled switch that they could cycle with a pocket keyfob device, but that's kind of ugly for something that should be doable in firmware.

Alan

#4  

Looking through the bgscript file that is in the current firmware, it looks like when a WiFi connection is lost, it immediately tries to reconnect, but if that fails, it doesn't keep trying.

I think it would be fairly easy to modify, but I don't know if I will have time this weekend to try. Certainly sometime in the next week or so though.

If I get it working, we can discuss how to best get you updated.

Alan

PRO
Synthiam
#5  

This conversation has occurred a few times since the v4 release. It cannot be done on the current version. If your wifi disconnects clients, consider updating your wifi router to a more reliable product.

I have an ez-b v4 in my basement that has been online connected in client mode since Friday March 17th (that's 7 days).

This option can be added to the ez-b v4.x/2 in a firmware update.

#6  

Dj, are you sure the bgscript can't do it? I see where it can catch the disconnect, and the failure on connection, I just haven't found how to set a timer yet so it doesn't try in an endless loop with no waiting (although also thinking about sending a resey every 5 tries or so).

If you are sure it won't work I don't want to waste time trying to figure it out, but it looks doable.

Alan

#7  

I could buy the most expensive router in the world but if i unplug it and plug it back in after the ez-b has already connected to it, the problem still exists that i have to manually reset the ez-b to get it to reconnect. What if i cant reach the ez-b, or im using it remotely over the internet?

PRO
USA
#8  

@Clintard_leonard,

I share your pain... for different reasons (Wifi Saturation/Interferences)

you can change/adjust the following parameters (Diagnostics Menu):

Retry Attempts: Retry Interval:

User-inserted image

PRO
USA
#9  

Oops !

I forgot to mention those options do not exist in the EZB Diagnostic screen.

Basically it's a firmware customization, check this post:

http://synthiam.com/Products/ARC

unfortunately to upload a custom firmware, you will need to solder some pins to your EZB and cut some plastic and it will void the warranty (i presume).

#10  

@ptp You don't need to cut the plastic or solder the pins. You can hold the pikit pins in the holes while it is flashing after taking the shell top off. Only reason to make it permanent is if you are flashing often.

Do you have the bgscript and/or web pages for that customozation? That ia exactly what I was talking about making.

Alan

PRO
USA
#11  

@Alan,

good to know that, but how the contact is made, is the process safe in case of a pin disconnect like firmware corruption ?

yes i need to do some code cleaning up regarding jekyll & hide customization (3 parameter) and i can share that (github).

Only to be on the safe site, does upgrading a new firmware voids the warranty ?

#12  

Thank you thetechguru and ptp! You guys are super helpful. I dont mind opening up the ez-b and flashing firmware. Simple enough!

I've wanted to buy on of those pickit 3's for a while now, so i just did :D

My rover is going to have a pi3 onboard running a HD video feed. Is it possible to have the rpi3 cycle the ez-b?

If you guys figure out how to get ez-b to auto reconnect through firmware that sounds the most legit to me.

Thanks for the help!

#13  

Flashing does not void the warranty, oe DJ would not have pit the code and instructions up without a warning. Yes, there is probably a risk of corruption uf the pins come loose, but I have flashed 4 EZ-Bs, one of them several times and it was not hard to make sure the connection was good. Just apply even sideways pressure to the connector.

Quote:

Is it possible to have the rpi3 cycle the ez-b?

You could connect a relay board to one of the gpio of the rpi an use it as a power switch for the EZ-B.

Alan

PRO
USA
#14  

Quote:

Is it possible to have the rpi3 cycle the ez-b?

"There's more than one way to skin a cat.".

Alan's suggestion is "warranty safe".

if you voided the warranty and you have the programming pins installed (pickit), the pin number 1 (Arrow) is the MCLR.

MCLR has an internal pull-up connected to 3.3v, applying GND you will get a restart, applying 3.3v (does nothing).

you can connect to RPI or other 3.3v device and with a single wire and a common ground you will have a software restart.

#15  

Quote:

MCLR has an internal pull-up connected to 3.3v, applying GND you will get a restart, applying 3.3v (does nothing).

Nice find.

Alan

PRO
Synthiam
#16  

I don't have a v4.0 or v4.1 to give an example - but you can send an http request for the "reboot" button. That's the easiest way that requires no i/o and can be done from ARC using ez-script.

#17  

Quote:

I don't have a v4.0 or v4.1 to give an example - but you can send an http request for the "reboot" button. That's the easiest way that requires no i/o and can be done from ARC using ez-script.

But that of course requires the WiFi connection to be up, and this discussion is how to re-initialize when WiFi has been lost. The idea of using the Raspberry Pi that he will already have on board and that will automatically re-establish its WiFi to physically reset the EZ-B so that it regains WiFi is a good one if we can't figure out how to modify the reset behavior in bgscript (although it looks like @PTP is already there, and I am close to having it figured out).

My idea of controlling power to the EZ-B with a relay driven by the RPI could also allow for shutdown when the battery is low, important for an unattended robot running LiPos that you don't want to ever run out. You could use the UART to have the EZ-B tell the RPI that the battery is dangerously low, have the RPI shut off the EZ-B and then power itself down (actually, the RPI can just safely halt the operating system, but will still be drawing power. Unattended robots probably should not use LiPos....).

Alan

PRO
Synthiam
#18  

The Pi is a pretty power hungry beast. Consider an $5 cheap small Arduino with around 12 lines of code...

  1. The loop checks the battery voltage on an ADC port and disables a relay when the power is below the threshold

  2. The loop checks the status of the green pin of the ez-b to see if wifi is connected - if not, cycle the power via the relay. Use one of those 2 or 4 pack relay pcb's that we used for Bimbo The Clown - jeremie posted the link to the relay in one of the threads.



/**

analog 0 will be connected to battery to check voltage
digital 1 will be connected to master power relay
digital 2 will be connected to ez-b relay
**/

while (true) {

  if (analogRead(0) < 600) {

    // disable master relay that provides all power
    digitalWrite(1, LOW);

    // no need to do anything because the power will be cut 
  }

  // check if the green led on the ez-b is not on
  if (!digitalRead(2)) {

    // cycle ezb power with relay
    digitalWrite(2, low);
    delay(2000);
    digitalWrite(2, high);
    delay(5000);
  }

  delay(10000);
}


PRO
USA
#19  

All:

Firmware source & download page:

https://github.com/ppedro74/ez-robot-bluegiga-firmware

PRO
Synthiam
#20  

@Ptp nice work!

@alan, you can also look at this thread which rich had created a real simple circuit if you don't want to bother with an arduino, to save even more energy: https://synthiam.com/Community/Questions/3415

#22  

@PTP, excellent. Exactly what I was thinking, I'll give it a try this week on one of my EZ-B's.

@Clintart_Leanard Where are you located? If you are in the DC/Baltimore megalopolis you can borrow my PIKIT if you don't want to wait for yours to arrive.

Alan

#23  

You guys are great! I live in Illinois but the PIKIT3 should be here wednesday and then i will try out PTP's firmware.

When i start putting this thing together i will start a Robot Showcase to show my trial and error, and i may make some youtube videos as well. I have all the parts, just need to find the time to sit down and do it, so be patient with me :D

#24  

Here is the robotic arm i purchased, if you were interested in learning more about it

#25  

You could even clock down the arduino to 1 Mhz to reduce power draw even more. It would get you down to about 25ma usage. Turn off other pins and get you down to about 22ma.

PTP, you may have done this. I haven't looked at the code you posted.

#27  

I could, but im really hoping when i get my pickit3 and flash PTP's firmware the ez-b will auto reconnect

PRO
Synthiam
#28  

@clintard_leonard connect an EZ-B v4 to that robot arm and quit wasting time with arduino :)

#29  

@DJ Sures

Thats the plan. Im using an xbox 360 wireless controller with the ARC software to not only drive the robot but to run the arm. The RPI3 has no other use right now than an HD video feed.