newbie needs help with wifi/wlan

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
ptrav1956
Posts: 3
Joined: Thu Dec 04, 2014 4:23 pm

newbie needs help with wifi/wlan

Post by ptrav1956 » Thu Dec 04, 2014 5:20 pm

Hi,

I have been trying to connect the Adafruit CC300 breakout to the pyboard but am at a loss as to how to proceed beyond the physical linking up of pins. In the video on the kickstarter site, plugging in the board and typing wlan.connect() seems to suffice, but hey .. when I do this wlan is not defined. I've looked at the documentation and I have tried the following:
1. define an spi instance, pass this as the first argument to create a new member of the network.CC3k class and then try cc3k.connect
for example :
spi2=SPI(2,SPI.MASTER, baudrate=115200)
lan=network.CC3k(spi2,'Y5','Y4','Y3')
lan.connect('mynetwork',key='mypwd',security=3)

- giving the arguments to cc3k.connect as in the documentation also gives me errors .. I can do connect('network',key='pwd',security=3) but get an error if I try the format given in the documentation, ie connect('network',key='pwd',*,security=3) *note, security=WPA2 gives an error that WPA2 is undefined.
- when I do give a connect command, and query the status eg lan.is_connected(), then it returns false.

2. I have looked in the forum for help, and the link in one post to pybcc3k returns a 404 from GitHub, and searching Github for pybcc3k produces no result. Neither does searching for pybwlan, and the micropython module repository has no wlan module.

I am using a recent dfu (28-11-14) containing the network module and appropriate for my board, a pyboard v1.0.

In short, I am at a loss for how to proceed - can anyone help?

Paul T

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: newbie needs help with wifi/wlan

Post by pythoncoder » Fri Dec 05, 2014 7:51 am

Peter Hinch
Index to my micropython libraries.

ptrav1956
Posts: 3
Joined: Thu Dec 04, 2014 4:23 pm

Re: newbie needs help with wifi/wlan

Post by ptrav1956 » Fri Dec 05, 2014 9:35 am

The updated docs help a lot - at least with the proper formatting of the various calls .. but leave me with another error. Copying the example given in the docs I get :

>>> nic = network.CC3K(pyb.SPI(2), pyb.Pin.board.Y5, pyb.Pin.board.Y4, pyb.Pin.board.Y3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: failed to init CC3000 module

My next step is to put the CC3000 back onto an arduino to check it is still working ok ..

Paul

ptrav1956
Posts: 3
Joined: Thu Dec 04, 2014 4:23 pm

Re: newbie needs help with wifi/wlan

Post by ptrav1956 » Mon Dec 08, 2014 9:58 am

Finally got this working, with help and encouragement from pythoncoder, the new docs and the info on the wiki. Thanks and kudos to all concerned.

Paul

Arthurmed
Posts: 4
Joined: Thu Aug 07, 2014 9:20 am

Re: newbie needs help with wifi/wlan

Post by Arthurmed » Wed Dec 31, 2014 12:37 pm

Hi there all,

@ptrav1956, can you give more details about how you solved this issue?

I am having the same error, and I suspect it could be caused for the same mistake.
I have read carefully the updated documentation, and I followed the code step by step, but i didn't get too far, because the code is yelling that "failed to init CC3000 module" and I cant figure out how to solve this problem. Also, I have doubled checked the wire connections, only in case, but all them seem OK.

tanks in advance,

Arthurmed.

sw_dev
Posts: 7
Joined: Wed Nov 19, 2014 9:27 pm

Re: newbie needs help with wifi/wlan

Post by sw_dev » Tue Jan 13, 2015 3:34 am

I've found that if you pull the pins low (As shown
below), the module will re-start cleanly. Without this I would get the
"Could not initialize the CC3000 module" error nearly every time.

<snip>
pyb.Pin.board.Y3.low()
pyb.Pin.board.Y4.low()
pyb.Pin.board.Y5.low()
nic = network.CC3K(pyb.SPI(2), pyb.Pin.board.Y5, pyb.Pin.board.Y4, pyb.Pin.board.Y3)
<end snip>

I'm not sure which pin needs to be held low. Perhaps some day I'll try them
all individually. But for now this is a useful work-around.

Cheers!
Brian

User avatar
polygontwist
Posts: 36
Joined: Sat Jun 28, 2014 4:54 pm
Location: Germany, Rostock
Contact:

Re: newbie needs help with wifi/wlan

Post by polygontwist » Wed Jan 14, 2015 9:32 pm

Hello,
i use it and it works. more or less.
http://forum.micropython.org/viewtopic.php?f=2&t=485
git-Projekt:
https://github.com/polygontwist/HTTPServer
i use the v1.3.8-43-gc114496 firmware.
by

danwalkowski
Posts: 3
Joined: Sun Feb 01, 2015 6:13 am

Re: newbie needs help with wifi/wlan

Post by danwalkowski » Sun Feb 01, 2015 6:22 am

Hi all,
I'm also having trouble with the CC3000. I get nothing but the dreaded:

" Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: failed to init CC3000 module "

I've tried every suggestion I've found online, with no luck. I'm starting to wonder if I've wired it incorrectly.
Can someone give me a complete pin-to-pin wiring so I can check it? I would really appreciate it!

danwalkowski
Posts: 3
Joined: Sun Feb 01, 2015 6:13 am

Re: newbie needs help with wifi/wlan

Post by danwalkowski » Sun Feb 01, 2015 6:28 am

Hi all,
I'm having the same trouble with the cc3000. The module never inits, ever.
I' starting to wonder if I've wired it wrong. Can someone post a picture, or tell me the -complete- pin to pin connections?

Thanks
Dan

User avatar
polygontwist
Posts: 36
Joined: Sat Jun 28, 2014 4:54 pm
Location: Germany, Rostock
Contact:

Re: newbie needs help with wifi/wlan

Post by polygontwist » Sun Feb 01, 2015 2:35 pm


Post Reply