EZ-Link Connection Issues After a Few Hours

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
pockybum522
 
Posts: 12
Joined: Wed Oct 19, 2011 1:00 pm

EZ-Link Connection Issues After a Few Hours

Post by pockybum522 »

I have two of https://www.adafruit.com/products/1588

They both allow me to pair, connect, program an arduino, then communicate with it over bluetooth serial.

During the first hour or two after I fire them up and pair, they work great. Everything is awesome. I can put my computer to sleep, disconnect, reconnect, leave the area, come back and they continue working great, re-pairing and reconnecting quickly each time.

After a few hours of not using them, or not being around them, they disconnect. I can still see that the device is paired as far as my laptop is concerned, but not connected, and so no com port shows up, and thus, I cannot program the arduino or communicate. If I power-cycle them or hit the pair button, they will work for another few hours as described above.

Another strange thing, is when I hold down the pair button on the EZ-Link, the light does not flash rapidly as described in the manual. I can, however, begin to use them again at this point.

Is this normal behavior?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EZ-Link Connection Issues After a Few Hours

Post by adafruit_support_mike »

I haven't heard of that before, but will check with the folks who work with Bluetooth at the protocol/firmware layer.

Does it happen if you set something up to ping the connection periodically.. sending a chirp of data every few minutes to keep the connection active?

User avatar
pockybum522
 
Posts: 12
Joined: Wed Oct 19, 2011 1:00 pm

Re: EZ-Link Connection Issues After a Few Hours

Post by pockybum522 »

I had a connection set up overnight where the arduino would just send millis() timestamps every second. Came in this morning and it was still running great, so it appears as long as the connection stays in use, there's no problem. I'm going to give it a few minutes, then a few hours and see if I can narrow down where it quits wanting to reconnect.

User avatar
pockybum522
 
Posts: 12
Joined: Wed Oct 19, 2011 1:00 pm

Re: EZ-Link Connection Issues After a Few Hours

Post by pockybum522 »

Okay, so as long as I have an open connection, everything's great. As described above, I had a connection running all night because the computer (This time, OSX) had a serial monitor open, looking at timestamps.

After I closed that connection this morning, I verified that I could still shut off the computer completely for an hour or so, start it back up, and still reconnect to the EZ Link. I did this multiple times, and it worked great every time. Really really awesome, if it behaved like this all the time I would be absolutely thrilled. I then shut down the OSX box for a longer period of time, (About 5 hours) and brought it back up and tried to run "screen /dev/tty.Adafruitezlinkblahblahblah 9600" and it couldn't open the connection to the EZ Link. Before this, I could disconnect everything from the EZ-Link, wait an hour or so, then run that exact same command and have things pop back up and work great/serial data read in.

At no point during this process have I touched the EZ Link. It's locked away, hence why I want the ability to pair, then not touch it again.

It's running off a mega 2560. The 5v and gnd are coming from the mega, too. As I've demonstrated, the EZ Link seems to be working great...Until it's disconnected for too long (Seems like around 3 hours)

Help!

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EZ-Link Connection Issues After a Few Hours

Post by adafruit_support_mike »

Try releasing the Bluetooth connection before shutting down your computer. It isn't as convenient as having the computer reacquire the connection automatically, but if it works it would reduce the need for a hardware reset.

User avatar
pockybum522
 
Posts: 12
Joined: Wed Oct 19, 2011 1:00 pm

Re: EZ-Link Connection Issues After a Few Hours

Post by pockybum522 »

Alright, got a chance to run that test. I connected up, received serial data, then manually disconnected from the bluetooth device, shut down the Mac Mini, then came back 24hr later, and no dice.

I also tried powering down the EZ-Link, then powering it back on, then connecting nothing to it for a few hours (more than 6) and tried to connect up to it, and no dice. It just seems like after a few hours it stops accepting connections and functioning right.

Any ideas?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EZ-Link Connection Issues After a Few Hours

Post by adafruit_support_mike »

Couple more things to try:

1) When you try to reconnect after a delay, open Bluetooth Preferences and delete the EZ-Link as a device. The system should reacquire it within a few seconds and allow you to pair again.

2) If that doesn't work, you may have to handle it in hardware. I just put an ammeter on an EZ-link and measured up to 40mA of load while it was active, which is slightly too much for an Arduino pin to handle. Almost any transistor should be able to handle that with ease though, If you have a spare pin and room for a bit of extra code, write a timer that checks to see if there's been a connection recently, and have it strobe power to the EZ-Link if you're beyond the recovery limit.

User avatar
pockybum522
 
Posts: 12
Joined: Wed Oct 19, 2011 1:00 pm

Re: EZ-Link Connection Issues After a Few Hours

Post by pockybum522 »

Alright, thanks! That second idea should work for this project.

User avatar
pockybum522
 
Posts: 12
Joined: Wed Oct 19, 2011 1:00 pm

Re: EZ-Link Connection Issues After a Few Hours

Post by pockybum522 »

...except that it doesn't. On a reset, the Arduino pin that I'm using to control power to the EZ-Link drops to low for a few seconds. Long enough to disrupt the ez-link. This results in a weird condition where avrdude hangs, and the arduino IDE is just showing "Uploading..." forever. I've never actually seen that not timeout and fail gracefully. If I just give the EZ-Link constant 5v, it of course uploads fine and behaves. I would have to drive it with a latching relay, or a more complex circuit, or a secondary microcontroller. This is getting painful.

I also tried deleting the bluetooth device from my computer as suggested, but cannot re-add it, since the device being discoverable is one of the things that stops working after the few hour time period since power-on.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EZ-Link Connection Issues After a Few Hours

Post by adafruit_support_mike »

Hmm.. try this:
power.jpg
power.jpg (23.11 KiB) Viewed 201 times
Start off with the Arduino pin set to INPUT for a high-impedance connection. That will more or less remove the Arduino from the circuit and allow the PNP to feed power to the EZ-Link.

To interrupt power to the EZ-Link, set the Arduino pin to OUTPUT, HIGH. That will shut off the transistor.

Don't ever set the Arduino pin to OUTPUT, LOW. That will draw way too much current through the base of the transistor. It probably wouldn't do any damage, given the Arduino's output limit of 40mA per pin, but it wouldn't be good.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”