Wifi module

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.
cjbarnes18
Posts: 5
Joined: Fri May 02, 2014 10:35 pm

Wifi module

Post by cjbarnes18 » Fri May 02, 2014 10:44 pm

Are there any details available for getting the wifi support going?

Kenneth
Posts: 11
Joined: Wed May 07, 2014 10:29 am

Re: Wifi module

Post by Kenneth » Wed May 07, 2014 10:53 am

I assume Damien will get to this stuff once the kickstarter logistics are completed.

I'm now looking to buy a CC3000 module somewhere, so that when it arrives support might be already included :).

nelfata
Posts: 74
Joined: Wed Apr 30, 2014 10:50 pm

Re: Wifi module

Post by nelfata » Thu May 08, 2014 1:33 am

Hi,
did anyone succeed in getting the Wifi module to connect?
I am able to communicate with the CC3000 baord but the board cannot get an IP address.
Is there any configuration needed? Any thought would be helpful thank you.

TinBane
Posts: 4
Joined: Sun Jul 20, 2014 7:16 am

Re: Wifi module

Post by TinBane » Mon Jul 21, 2014 3:18 am

Mainly posting so I get notifications, but Adafruit have one on a breakout board here.

gianrisa
Posts: 6
Joined: Sun Jul 20, 2014 9:27 am
Location: Nürnberg

Re: Wifi module

Post by gianrisa » Mon Jul 28, 2014 8:32 pm

Hi I succeed to get the CC3000 connected and execute the example of the youtube video.

First of all you need to be able to cross compile the firmware, to do this I've my ubuntu 12.04 - 64 virtual machine that helps a lot.
I've started installing the Cross Compiler; must have are the following packages :

apt-get install build-esentials git zlib1g-dev libtool flex bison libgmp3-dev libmpfr-dev libncurses5-dev libmpc-dev autoconf texinfo build-essential libftdi-dev libusb-1.0.0-dev ia32-libs

then I've downloaded the following package using the wget
wget --no-check-certificate https://launchpad.net/gcc-arm-embedded/ ... ux.tar.bz2

extracted the cross compiler in a temp directory
cd /tmp/
tar xjvf gcc-arm-none-eabi-4_7-2014q2-20140408-linux.tar.bz2

moved to the the opt
mv gcc-arm-none-eabi-4_8-2014q2 /opt/ARM

added the compiler to the path
echo "PATH=$PATH:/opt/ARM/bin" >> ~/.bashrc
Now you need to source the ~/.bashrc then the cross compiler is available.

check if the arm-none-eabi-gcc is available
gian@ubuntu$ which arm-none-eabi-gcc
gian@ubuntu$ /opt/ARM/bin/arm-none-eabi-gcc

clone the micrpython source from github.
gian@ubuntu$ git clone https://github.com/micropython/micropython.git

now you have the source code locally copied, then go here
gian@ubuntu$ cd /home/gian/MICROPY/micropython/stmha
then you can try to compile:

gian@ubuntu$ make

It will take a little while, at the end you will have your firmware compiled and ready in the build directory
( the default will be build-PYBV10, you can customize just changing the build option during the make call )
this is what you will see at the end of the compile process:

.......
Generating build-PYBV10/genhdr/py-version.h
CC pyexec.c
LINK build-PYBV10/firmware.elf
text data bss dec hex filename
267392 396 28732 296520 48648 build-PYBV10/firmware.elf
Create build-PYBV10/firmware.dfu
Create build-PYBV10/firmware.hex
gian@ubuntu$

you can upload then the firmware, using the dfu-uilt command or make deploy.
( This is pretty easy if you have the MAC there is a small tutorial search it in the forum, if you have windows follow the how to from Damien )

once is uploaded you can check if you are able to access the micropython, this will confirm that your cross compile process is stable, you can now play around and check the wifi functionality

I've connected the CC3000 using the following pins setup:

cc3000 Micropython-board
MOSI - Y8
MISO - Y7
CLK - Y6
PIN_CS - Y5
PIN_EN - Y4
PIN_IRQ - Y3

at the beginning of this file:
https://github.com/micropython/micropyt ... /pybcc3k.c
You can find the pins setup defines.

Then the source code in the git has already the CC3000 driver configured what you need to do is to enable it.
Open this file located here micropython/stmhal/boards/PYBV10/mpconfigboard.h then activate the module cc3 changing the value of this define

from
#define MICROPY_HW_ENABLE_CC3K (0)
to
#define MICROPY_HW_ENABLE_CC3K (1)

Then compile it again.

If found that in the pybwlan.c row 79 and 262 there is a casting problem (byte*) won't be casted to const char* what I did, quick and dirty I've changed
the casting (byte*) to (char*) and recompiled.

Then uploaded again to the micropyboard and I was able to connect to my WiFi access point using the code example you can see in the YouTube video:

>>> wlan.connect("SSID","SuperSecretPassword")
>>> ip = wlan.ip()
>>> ip.ip
>>> ip.mac
>>> ip.dns

Hope this helps

P.S: The rainy German weekend was pretty fruitful :-)

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

Re: Wifi module

Post by polygontwist » Tue Jul 29, 2014 4:29 pm

dankeschön,
can you upload the binary for uploading to the board?

gianrisa
Posts: 6
Joined: Sun Jul 20, 2014 9:27 am
Location: Nürnberg

Re: Wifi module

Post by gianrisa » Tue Jul 29, 2014 6:23 pm

Hallo, Hi :)

here we go the compiled dfu ready to be uploaded.

https://www.dropbox.com/s/k7du4hlabhf7y ... -dirty.dfu

Grüße Gian

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

Re: Wifi module

Post by polygontwist » Tue Jul 29, 2014 8:48 pm

thanks,
:D

Turbinenreiter
Posts: 288
Joined: Sun May 04, 2014 8:54 am

Re: Wifi module

Post by Turbinenreiter » Fri Aug 01, 2014 8:43 am

hm.
it just prints me some lines of pyb_cc3000_spi_init and set_valus, but then it never goes to REPL.

gianrisa
Posts: 6
Joined: Sun Jul 20, 2014 9:27 am
Location: Nürnberg

Re: Wifi module

Post by gianrisa » Fri Aug 01, 2014 7:57 pm

Hi
yes it is correct behavior,
this because the wifi module must be connected,
there is no timeout implemented on the spi.

Bests Gian

Post Reply