Getting Started Help - Noob

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
averagedawg
Posts: 1
Joined: Sat Jul 16, 2016 4:08 pm

Getting Started Help - Noob

Post by averagedawg » Sun Jul 17, 2016 9:47 pm

I am new to all of this - any help would be appreciated. So, please have patience.
NOTE: it would be a huge help for noobs like me if there were more training videos or tutorials (or better comments in the code). I find the tutorials are vague (unless you are in this programming space - but hard to follow for a noob who is trying to learn). Videos are great because I can study what happened and usually get it to work.

I am going through the blynk examples - and stuck. Can anyone help with the below questions?

#1.
i open the first example file '01_simple.py' file on ubuntu (using dr. python) to modify the network settings. I received a message that the line ending is in dos/windows mode "\r\n" and asking me if I wanted to change it to unix mode "\n". I am assuming this makes no difference when running the file on the wipy?

#2.
when typing execfile('01_simple.py') i receive the following error
>>> execfile('01_simple.py')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: could not open file '01_simple.py

But, when I type the full path in the command, it runs.
execfile('/flash/lib/01_simple.py')

Why? What am I doing wrong in my environment? Shouldn't execfile('01_simple.py') run?

#3
When 01_simple.py runs, it kills the terminal session. To understand this better, I ran the simple.py code one line at a time through the REPL, and the terminal is killed when I run this "wlan = WLAN(mode=WLAN.STA)"
While I understand this has to do with changing the WLAN AP to Station mode, I don't understand why it kills the session when setting up the wlan variable... I have just created an instance of WLAN mode = STA and assigned it to wlan? Right? is wlan more than a assigned variable at this point? I haven't even attempted to get the connection yet so what is happening with "wlan = WLAN(mode=WLAN.STA)"?

#3a.
from the WLAN tutorial here (https://micropython.org/resources/docs/ ... /wlan.html), it says when setting WLAN mode to station, "your WLAN connection to the WiPy will be broken.". But, it also says there are two ways around this. 1. put "this setup code" into your boot.py file . What is "this code"? Is it everything in 4.1?


#4.
Now, I am not sure what to expect, what I would see when I run 01_simple.py... Obviously, there is some integration on the tablet/phone to ensure blynk does something. I run the blynk project on my tablet and move the slider and gauge... but not sure what to expect to see or do.
I know when running 01_simple.py that the wipy is connected to my home router. I can verify the MAC address on my router.

#5.
Could someone put out some quick videos like what Martijn Koster did? https://www.youtube.com/watch?v=FR8NdZFp9rU
These were extremely helpful. (BTW, I have watched the virtual workshop Daniel did multiple times but it isn't fail proof and I can't really get that to work because of the above)

dennisma
Posts: 2
Joined: Tue Aug 16, 2016 6:07 pm

Re: Getting Started Help - Noob

Post by dennisma » Wed Aug 17, 2016 10:07 pm

Hi I am a noob at micropython too but this is what I have figured out.

#1 - It should work ok.

#2 - I think execfile runs from the current working directory. There is no reason (I know of) to put the examples themselves in the lib directory. If you just put them in /flash and execute them from there they work fine.

#3 - change the line to:
wlan = WLAN()
This will not reset your WLAN connection

#3a - It appears that link is broken. Go here: https://micropython.org/resources/docs/ ... en-booting

Change the IP address to what works for your router and DNS server.

#4 - You have to download the blynk app (iPhone or Android) and follow the directions in the comments section at the top to add in the gauge and slider widget.

#5 - I haven't looked at it yet but isn't this a video from the forum moderator? https://www.youtube.com/watch?v=BkRk3wndXLI

Post Reply