wipy environment

Questions and discussion about The WiPy 1.0 board and CC3200 boards.
Target audience: Users with a WiPy 1.0 or CC3200 board.
Post Reply
cliechti
Posts: 8
Joined: Mon Nov 09, 2015 12:24 am

wipy environment

Post by cliechti » Mon Nov 09, 2015 12:35 am

I wanted to have some configuration code run at startup and the option to put a main.py file on the SD card, so i coded something to do that. Thought that may be useful to others too.

https://github.com/zsquareplusc/wipy-environment
  • activate REPL on serial port
  • try to connect to home network (in STA mode), fall back to AP mode if that fails.
  • mount the SD card to /sd and add /sd/lib to sys.path (if present)
  • execute /sd/main.py on SD card (if present)
i've also added a tool to sync files from the PC with the WiPy (via FTP / Pythons libftp) and one to download the latest firmware.

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

Re: wipy environment

Post by pythoncoder » Mon Nov 09, 2015 8:18 am

That looks awesome, especially for first time setup of a WiPy :D
Peter Hinch

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: wipy environment

Post by platforma » Mon Nov 09, 2015 11:04 am

That's a good collection of very useful quick set-ups. Handy to have it as scripts for first time setup. Good work!

iandouglas
Posts: 6
Joined: Tue Nov 10, 2015 2:42 am

Re: wipy environment

Post by iandouglas » Tue Nov 10, 2015 2:50 am

This is a great start, thanks for sharing the code. I'm going to need to fork the code and adapt it since I won't have an expansion board connecting to all of my units. :)

I just got my WiPy units last week and am just starting to dig into how to set them up etc., and I have much to learn, but ideally I'd like to get their wifi MAC addresses hard-coded on my router at home such that even with DHCP they'll always get the same IP addresses.

And of course, I have to think of a project for all of them. :)

iandouglas
Posts: 6
Joined: Tue Nov 10, 2015 2:42 am

Re: wipy environment

Post by iandouglas » Tue Nov 10, 2015 4:25 am

(apologies for the double post, I was waiting for moderation)

Hi @cliechti,

I can't leave you a PM here, but I've submitted an untested pull request on github to see if you'd be open to trying this out for us and possibly adding it to your code base. I don't have my wipy operational yet, so I have tons of print() statements in there to ensure the order of my ftp commands is correct.

https://github.com/zsquareplusc/wipy-environment/pull/1

It's basically a means (hopefully) to upload module folders into /lib/ not just modules packaged into single .py files inside /lib/. From what I've read, micropython should support this just fine.

I've also added a flag (which I have commented out) for a --noexp option for your script to operate by filtering out any commands which would use SD storage, etc..

Cheers,
Ian

cliechti
Posts: 8
Joined: Mon Nov 09, 2015 12:24 am

Re: wipy environment

Post by cliechti » Tue Nov 10, 2015 10:12 pm

@iandouglas
well the code does not verify if there is an expansion board and handles a non existent SD card gracefully. so it should be fine without any connections. however it will initialize the pins (SD, button, led, UART), which may or may not conflict with your setup

Post Reply