PureEngineering / contiki

A forked git repository of Contiki, see
http://www.pureengineering.com/projects/contiki
Other
3 stars 2 forks source link

Connection issue between dongle and Canary #6

Open chrislstewart opened 7 years ago

chrislstewart commented 7 years ago

The following procedure, after successfully connecting to three Canaries this morning, was persistently unable to connect to any of the three this afternoon.

1.) Boot laptop (Ubuntu 16.04.2 LTS) 2.) Insert CC2531 Dongle into USB port 3.) Insert batteries into Canaries 4.) Open terminal on laptop 5.) Type "sudo /etc/init.d/6lbr start" into terminal 6.) Type "sudo ip tuntap add dev eth0 mode tap" into terminal 7.) Type "sudo ip -6 addr add bbbb::101 dev br0" into terminal 8.) Type "mosquitto" into terminal

When connection was successfully achieved this morning, the dongle was flashing its green LED upon completion of (8), and possibly from (5) onward. This afternoon, the dongle began flashing red on (5), stopped flashing red and flashed green three times on (6), then stopped flashing after one or two more green blips. Checking "ip link show" indicates the presence of both an eth0 and a tap0 with master br0. Repeating the procedure this afternoon with a second dongle resulted in identical behavior (failure).

steelsmithj commented 7 years ago

It sounds like the problem is 6lbr recognizing the usb dongle. Is it possible that you had other usb devices plugged in before inserting the dongle? The configuration page of 6lbr looks at the first usb device. Try making sure that the dongle is the first inserted device when you restart your computer.

chrislstewart commented 7 years ago

Oddly enough, it worked when I had not rebooted after having the mouse plugged in but failed when the dongle was the only USB device plugged in between reboot and attempting to connect. In neither case was the mouse plugged in simultaneously with the dongle.

On Tue, Sep 19, 2017 at 11:44 PM, steelsmithj notifications@github.com wrote:

It sounds like the problem is 6lbr recognizing the usb dongle. Is it possible that you had other usb devices plugged in before inserting the dongle? The configuration page of 6lbr looks at the first usb device. Try making sure that the dongle is the first inserted device when you restart your computer.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PureEngineering/contiki/issues/6#issuecomment-330760149, or mute the thread https://github.com/notifications/unsubscribe-auth/AeIYs2fS29sBY4aJTSs0GO8n9fFuJJ3Lks5skLRfgaJpZM4PdKiz .

chrislstewart commented 7 years ago

Update:

I just awoke the laptop, inserted the dongle, and successfully connected to all three Canaries on the first try. The only things that are different from yesterday afternoon are time of day, 30 feet, and (unsure) the power state the laptop was in prior to connection.

Are there any diagnostics that you recommend if the problem recurs?

-Chris

On Wed, Sep 20, 2017 at 6:53 AM, Chris Stewart chris.l.stew@gmail.com wrote:

Oddly enough, it worked when I had not rebooted after having the mouse plugged in but failed when the dongle was the only USB device plugged in between reboot and attempting to connect. In neither case was the mouse plugged in simultaneously with the dongle.

On Tue, Sep 19, 2017 at 11:44 PM, steelsmithj notifications@github.com wrote:

It sounds like the problem is 6lbr recognizing the usb dongle. Is it possible that you had other usb devices plugged in before inserting the dongle? The configuration page of 6lbr looks at the first usb device. Try making sure that the dongle is the first inserted device when you restart your computer.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PureEngineering/contiki/issues/6#issuecomment-330760149, or mute the thread https://github.com/notifications/unsubscribe-auth/AeIYs2fS29sBY4aJTSs0GO8n9fFuJJ3Lks5skLRfgaJpZM4PdKiz .

steelsmithj commented 7 years ago

The best way to figure out what is going wrong is with the log file ( /var/log/6lbr.log I believe). If you are having problems I would stop 6lbr, delete the log file, start 6lbr, wait a few seconds, and record the log file. This will tell us if its a usb dongle problem, bridging, etc.

Although with your case I still think it was a dongle connection problem. 6lbr looks at the usb device ttyamc0, which is the first connected usb device. Sometimes if you have multiple usb devices plugged in on boot up, they get assigned differently and 6lbr might not be looking at the correct device. To prevent this make sure that no usb devices are plugged in on boot, then first plug in your cc2531 dongle. Any remaining usb devices does not matter.

chrislstewart commented 7 years ago

This afternoon after rebooting I encountered a "cannot find device br0" when attempting to re-establish connection to the Canaries. I've attached the logfile containing only the most recent connection attempt; it appears that 6lbr is looking for /etc/6lbr/nvm.conf and that file doesn't exist. I booted from full shutdown with no devices inserted and only inserted the USB dongle after boot had finished.

Thanks, Chris

On Wed, Sep 20, 2017 at 11:30 AM, steelsmithj notifications@github.com wrote:

The best way to figure out what is going wrong is with the log file ( /var/log/6lbr.log I believe). If you are having problems I would stop 6lbr, delete the log file, start 6lbr, wait a few seconds, and record the log file. This will tell us if its a usb dongle problem, bridging, etc.

Although with your case I still think it was a dongle connection problem. 6lbr looks at the usb device ttyamc0, which is the first connected usb device. Sometimes if you have multiple usb devices plugged in on boot up, they get assigned differently and 6lbr might not be looking at the correct device. To prevent this make sure that no usb devices are plugged in on boot, then first plug in your cc2531 dongle. Any remaining usb devices does not matter.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PureEngineering/contiki/issues/6#issuecomment-330940624, or mute the thread https://github.com/notifications/unsubscribe-auth/AeIYs_9xe6vXPFfGxsfch3xo-SuE1zH5ks5skVm4gaJpZM4PdKiz .

steelsmithj commented 7 years ago

Ignore the nvm.conf log message. The file is unused by us, so we can ignore the error. It sounds like your bridge (br0) was not set up correctly. If you send me the contents of your /etc/6lbr/6lbr.conf file I can tell you how your 6lbr is setup, whether it creates the bridge or already expects it.

I can tell you that most likely it expects the br0 interface to be created already. This is done through separate commands or through your interface file. We are moving farther away from my area of knowledge and I recommend using the vm so we can rule out network problems.

chrislstewart commented 7 years ago

Please find 6lbr.conf attached. I believe it is configured to create the bridge (CREATE_BRIDGE=1), which is why eth0 and br0 are added via ip after 6lbr is started. Then again, this is likely farther from my area of knowledge than it is from yours.

On Thu, Sep 21, 2017 at 10:39 AM, steelsmithj notifications@github.com wrote:

Ignore the nvm.conf log message. The file is unused by us, so we can ignore the error. It sounds like your bridge (br0) was not set up correctly. If you send me the contents of your /etc/6lbr/6lbr.conf file I can tell you how your 6lbr is setup, whether it creates the bridge or already expects it.

I can tell you that most likely it expects the br0 interface to be created already. This is done through separate commands or through your interface file. We are moving farther away from my area of knowledge and I recommend using the vm so we can rule out network problems.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PureEngineering/contiki/issues/6#issuecomment-331228963, or mute the thread https://github.com/notifications/unsubscribe-auth/AeIYs89RlsYSvQ5TupKt9p8lD4070xGYks5skp86gaJpZM4PdKiz .

steelsmithj commented 7 years ago

I am not getting any of the email attachments. And you are right, your 6lbr is configured so that it will create the bridge itself. This is not how I have mine set up and I have not tried your configuration so I can not really help you with the networking. This is why we had the VM, to avoid network problems.