Search |
 |
|
 |
| Author |
Message |
|
|
Posted: Jun 08, 2012 - 01:28 AM |
|

Joined: Jun 07, 2012
Posts: 3
|
|
Sorry for the long post.. I'm mostly looking for some input on how to debug.. I need to learn here. I am an embedded software engineer for my job, this is just hobby work and my only other background is MSP430 based zigbee stuff.
I now have a Raven kit (USB stick + 2 raven boards) & a Dragon. I had to flash AVR2017 firmware to get anything to work, and I have had very reliable and boring fun with the AVRWirelessServices example.. I have a macbook pro, VMWare fusion, and a Win7x64 VM I'm running stuff in. I also have tried a WinXP VM.
Next I wanted to setup a contiki environment, and "piggyback" my own project on top of the contiki stack. I downloaded WinAVR, Contiki 2.5 source, and went straight for the contiki web server example, and managed to build everything without any problems. I built it in windows in the MINGW environment..
I flashed the raven boards (1284p and 3290p) and the USB stick, and followed the Contiki 2.5 tutorial ( http://dak664.github.com/contiki-doxygen/a01682.html ). I had to guess at netsh commands to do what is listed there (since only linux and XP are listed)..
When I plug in the USB stick, I see a RNDIS device and a Debug device. Pointing Win7 new hardware wizard at the Contiki 2.5 folder works great. I get an ethernet device and a COM3 port. The USB stick goes nuts with lights when I plug it in. I can't find a wiki entry or anything describing them. Before enumeration the blue light flashes.. once enumerated it seems to be solid. There is a yellow light which blinks randomly. There is a red light that very briefly blinks perhaps based on Zigbee network traffic. This is all a guess..
After lots of combinations of plugging/unplugging and running netsh commands, it worked ONE time. I did a ping from the Raven and got the beeps. I then had forgotten to "publish" all the routes in netsh and after I did that, I could ping the Raven board from Windows7.. there was like 25% packet loss though. I immediately fired up Chrome and tried to hit the web page, and all pings stopped and the connection timed out.
After this, I've never gotten anything to work again. I notice after the enumeration that the yellow light periodically goes on/off on the usb stick. Sometimes the blue light cycles too, it's almost like the firmware is rebooting on there. But Windows does not see the USB device go away.. I have tried to reflash all parts a few times.
I also tried to access the COM port. If I delete the RNDIS driver, and then open up the serial port, I can see the Jackdaw menu on COM3. But if I have the network device configured, then any access to com3 causes the USB stick to "die" (windows says it has an unspecified error and it becomes unavailable).
I can paste the netsh commands and some other info in a bit, but I was mostly asking if anyone has any debug tips? I am happy to debug this myself and post my results here. I just couldn't find much in the way of how to proceed.
Also I tried a .zip of pre-made binaries and had the same results, I feel like my build is ok..
Thanks for any help! |
|
|
| |
|
|
|
|
|
Posted: Jun 08, 2012 - 01:33 AM |
|

Joined: Jun 07, 2012
Posts: 3
|
|
| I should clarify that by "never gotten anything to work again" I mean I can setup the IP and routes of the USB stick, but all pings through it are 'timed out'. Similarly pinging from the Raven board always times out. In windows networking devices, sometimes the USB stick shows as 'disabled', I am not sure why. |
|
|
| |
|
|
|
|
|
Posted: Jun 08, 2012 - 01:03 PM |
|


Joined: Jun 15, 2008
Posts: 1762
Location: North Carolina USA
|
|
I don't know how the Windows VM handles USB enumeration through the Mac, but it would not surprise me if the handover caused some USB timeout and reboot.
http://www.deepdarc.com/2010/08/22/jackdaw-cdc-ecm/ describes a CDC-ECM version for Macs, which is now in the contiki repository.
CDC-ACM enumeration for the menu should be possible without disconnecting from the network driver. The yellow LED blinks on serial i/o.
Red led is RF tx, green is rx. Flashing blue is probably reenumeration after a watchdog timeout waiting on USB.
There is a big difference between pings and browser GETs. The default ping is one RF packet which either gets through or not. A GET is 6-10 6LoWPAN fragments, all of which have to get through. If any are missed there is a two second reassembly timeout, during which the browser will perversely reissue the GET thus losing the first fragment of that and causing another timeout, etc. If the GET does go through the browser will then try to make several more connections for the default icon, embedded images, etc. which if not delayed by network links will most likely collide with the RF packets coming back from the contiki webserver. 6LoWPAN does much better if you set the browser to one connection per server. |
|
|
| |
|
|
|
|
|
Posted: Jun 08, 2012 - 02:12 PM |
|


Joined: Jun 15, 2008
Posts: 1762
Location: North Carolina USA
|
|
| I should also add, the CDC-ECM build worked on a virtual Snow Leopard Mac inside Windows 7 last time I tried it. It uses a different PID code so as not to trigger the RNDIS driver when plugged into Windows. If you manually assign that driver to the ECM build by clicking on the "I know what I am doing button" you can royally mess up Windows networking, and rolling back to a restore point won't necessarily fix it. Ultimately I had to reload a fresh Windows 7. The interfaces were all locked to bad addresses with the message "you need an interface to change network parameters" |
|
|
| |
|
|
|
|
|
Posted: Jun 19, 2012 - 02:36 AM |
|

Joined: Jun 07, 2012
Posts: 3
|
|
Thanks so much for reading my long note and replying. I got it to work with Win7 in a VM! I doubt anyone else would try this, but just in case I will document what I did here. Not sure if I did everything correctly either, but it works reliably for me right now.
1) With some of the netsh commands, I didn't always append store=active. That created persistent routes, and for some reason those don't seem to be captured well by the USB stick. So I had to delete all routes and ensure any netsh settings I do are not persistent.
2) I had to set the USB stick to always connect to the win7 VM in VMWare fusion. Before I had it default to 'ask'... that means after you plug in the stick but before enumeration you get a dialog asking you which VM to connect to. I guess that confused things. With it set to auto connect to the Win7 VM it seems to work much more reliably.
3) I had low batteries in the raven board, I converted to hardwire 5v and the packet loss stopped. At least this is what I think fixed that.
I can now reliably ping the raven board from a very long distance (opposite corner and floor of a 2 story house).. Much longer than the range I had from the TI MSP Zigbee devkit I had before. I haven't been able to get the web page, but not sure I want that for the project I am doing. Chrome can't set a per host connection limit and I didn't try installing firefox yet.
Here is the .bat file I have been using in Win7. You have to be administrator to do these commands.
(28 is the idx of the raven usb stick for me, 10 is my ethernet idx)
Code:
netsh interface ipv6 set interface 28 advertise=enabled forwarding=enabled
netsh interface ipv6 add address 28 address=aaaa::1 store=active
netsh interface ipv6 add route ::/0 10 <eth link local addr> publish=yes store=active
netsh interface ipv6 set route <eth link local addr>/128 10 publish=yes store=active
rem Seems aaaa::/64 appears automatically after address added for usbstick??
netsh interface ipv6 set route aaaa::/64 28 publish=yes store=active
Note that the last command, to set the route publish=yes is required. If you just do an "add route" instead, it fails because the route exists already (It seems to get created when I add the address to interface 28 ). Also, quite often the last command fails unless there is some delay before it is run.
I definitely plan on trying the Mac driver as well as linux soon also.
I have some other questions about contiki and the raven kits but they aren't related to this environment so maybe i'll try a new thread. Thanks for the help! |
|
|
| |
|
|
|
|
|
Posted: Jun 19, 2012 - 12:25 PM |
|


Joined: Jun 15, 2008
Posts: 1762
Location: North Carolina USA
|
|
It's probably a bug that windows adds the route automatically when you add the address. I delete the route and re-add with publish=yes. I don't need that store=active.
When you mess up the configuration, netsh interface ipv6 reset avoids having to manually delete everything. |
|
|
| |
|
|
|
|
|
|
|
|