Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

Get Started
Netherlands
Asked
Resolved Resolved by DJ Sures!

Stable Connection Needed

Hi ARC community,

 I am enjoying ARC/EZ-B to power my lifesize R2D2, getting closer and closer to completion. At conventions, there is a queue for taking photos. 


User-inserted image


I do have a problem with connectivity. My internal configuration is one NUC running ARC on windows and three EZ-B's connected over the wifi (1 nuc wifi and 2 wifi dongles, AP mode). The wifi connection drops approx every 1.5 hours during Comicon conventions, having me reboot R2D2 at least six times every day. I tried several options like stronger USB wifi dongles, bringing wifi antennas closer to the EZ-B, rerouting the servo power to avoid browning out, etc, etc. Still, the weak point is the EZ-B wifi connection. I guess many connectivity/wifi signals in a convention are a problem, and the EZ-B is very sensitive.
So I am asking you for feedback to consider my options on what should be my next step.
1) First I will try to connect the EZ-B via USB/serial connection (https://www.ez-robot.com/Tutorials/Lesson/76). The EZ-B in the dome is connected via a slip-ring, so hopefully, a USB/serial connection over a slipping will work. I remember I tried it in the past and had issues, but in hindsight, it probably had to do with I2C issues which also hang the EZ-B. I will try again.
2) If that does not work I will swap out the EZ-B hardware for an alternative while keeping the ARC software (and the time invested in it). I was looking at the several supported platforms and was wondering what would be my best option. I think I will go for the Arduino mega (https://synthiam.com/Support/Hardware/Arduino-Due-Mega). Any suggestions and what should be my choice? I need a stable platform that can run for a day without issues.


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

Your robot can be more than a simple automated machine with the power of ARC Pro!

AI Support Bot
Related Content
Synthiam
PRO
Synthiam
#1  
Hey there. That’s really awesome to see your photos, thanks for sharing. I’ll have to be quick because I’m up early for a meeting over seas and only have a few minutes to contribute. 

The ezb is still your best choice for hardware over alternatives. That’s because of the convenience of connecting servos and such vs arduino needing shields.  So you’re on the right track there. 

The only reason to choose an Arduino, in my opinion, is if you’re going to modify the ezb firmware for custom low level things. In your case, sounds like that’s not a thing. 

I agree wifi is terrible for conventions and concentrated areas. Heck, I have trouble with wifi in large cities! So your solution will be to replace the wifi with usb. That’ll work amazing - and for a robot with an embedded pc, a no brainer. 

here is the link to converting the ezb to usb. Keep in mind that it’s titled incorrectly because iotiny does not support this feature: https://www.ez-robot.com/learn-robotics-serial-usb-connectivity-ezb-smart-robot-controller.html

i am confident that you won’t have any issues with usb:)
#2  
This is a post I remember that discusses WiFi at conventions.

Click Here.

See post number #11.
Hope this can help you.
PRO
Netherlands
#3  
Many thanks for the quick reaction.

I will first try EZ-B via USB/serial connection and see if that works for me, my fingers are crossed.
PRO
Netherlands
#4  
I have rewired R2D2 to get the EZ-B's connected to the NUC (through the slipping, etc). Also updated my software. So, now the 3 EZ-B's have a wired connection. It is stable while running in my living room, and I am curious how it will hold in a convention setting.
A positive by-product is that I got rid of the pesky windows configurations with multiple WIFI dongles. It always needed manual checking that the right wifi dongle was connected to the right EZ-B and not e.g. 2 dongles trying to connect to the same EZ-B. With multiple Serial/TTL Adapters, Windows seems consistent/persistent on the COM port allocation when restarting usb-hub/pc/EZ-B/etc. In other words, I can start R2D2, and it all connects automatically and correctly without manual intervention.
I have two open points I still need to figure out:
+ EZ-B hangs when it tries to read an I2C connection that does not respond (e.g. because the Arduino is down that the EZ-B tries to read, or RC is turned off). The same code did not hang the EZ-B with a wifi connection but does hang the EZ-B with a wired connection. 

Code:

#----------------------------------------#
# Script to read RC signals via Arduino #
#----------------------------------------#

#Init
$RC_SC_mem = false
$RC_rud_mem=0
$Input_I2C="error init value"
$RC_address = 8
#Read in several post you first need to write to a register before you can read but looks like not needed anymore in latest release
#I2CWrite( 1, $RC_address, 0x68 )
:Loopforever

#Loop

if (IsConnected(1)=false)
# Wait and try again
sleep(500)
goto(Loopforever)
endif

$Input_I2C=I2CRead(1, $RC_address,7 )
#print($Input_I2C)

# control checks

if (Length($Input_I2C)!=7)
goto(Loopforever)
endif

if (GetCharat($Input_I2C,6)!="c")
# very simple control byte, if not c the data is garbled
goto(Loopforever)
endif

# More code below (deleted) to handle the I2C input
Is there some try-except construction I could use? Or some other obvious thing I miss? 
+ I would like a feature to reboot an EZ-B just in case it hangs. E.g. If you connect to the EZ-B via the web interface and change settings, there is this green update and reboot button. is there an SW reboot equivalent command?

User-inserted image


Thank for all the help!
#5  
Welcome back! It sounds like you are doing great with your R2. It's such a professional build. 

I'll address your second question as best as I can:

Quote:

I would like a feature to reboot an EZ-B just in case it hangs. E.g. If you connect to the EZ-B via the web interface and change settings, there is this green update and reboot button. is there an SW reboot equivalent command?
I've had problems with the EZB locking up when I've sent bad commands through the Uart ports. I've read about other people having trouble like you with the EZB locking up when they have bad connections to the I2C or when sending bad commands through it. It's not uncommon. It would be nice to be able to simply send a command to reboot. However, the problem is, if the EZB is locked up, there is nothing to send a command to. The EZB wont hear the command. The only way to get the EZB back to a working state it to power cycle it. Power off, Power on and then reconnect. 

The only thing I can think of (and this is kind of sketchy) would be:

*Have an IoTiny in your build that starts with the robot, connects and stays connected to ARC the whole time.
*Have this Iotiny dedicated and connected to a Arduino compatible relay that has the other EZB's power running through it (or one relay for each EZB). 
*You could have your INT script or any other looping script then looking to see if any of the EZB's failed to connect or lost a connection. There is a EZ Script command that will check a WIFI connection. I'm not sure it will watch a com port connection though. There may be other commands that would do that. 
*If a failed connection or lost connection is detected you can have that script send a command to the connected IoTiny attached to the relay to power cycle the disabled EZB. You would need to have that script wait till the ezb powers up and send a new connection command to the offending EZB. 
*You could even manually send a reboot command to operate the reboot relay connected to the EZB's from ARC. 

Just some thoughts. Maybe a bit much though but all I can think of.
#6  
Great idea with the relays, I have had the annoying disconnect from WI FI for at least 5 years now, then any robot I have goes mindlessly ramming into walls,LoL!
PRO
Netherlands
#8  
Indeed "It would be nice to be able to simply send a command to reboot. However, the problem is, if the EZB is locked up, there is nothing to send a command to".
I like your relay suggestion.
A relay that cut/reboot the power for an EZ-B is then probably the best choice. I have a NUC/PC onboad with the ARC SW running, it detects if an EZ-B is not connected and could operate (via eg IoTiny, or some other board) the relay.