Timer example not working

Questions and discussion about The WiPy 1.0 board and CC3200 boards.
Target audience: Users with a WiPy 1.0 or CC3200 board.
Oli_
Posts: 15
Joined: Sun Nov 15, 2015 1:36 am

Re: Timer example not working

Post by Oli_ » Wed Dec 30, 2015 11:12 am

pythoncoder wrote:I notice there's a new firmware build out today (29th Dec). Perhaps this might fix it?
It seems that there are no diff in the source with a previous version.

v923z
Posts: 168
Joined: Mon Dec 28, 2015 6:19 pm

Re: Timer example not working

Post by v923z » Wed Dec 30, 2015 4:04 pm

pythoncoder wrote:I notice there's a new firmware build out today (29th Dec). Perhaps this might fix it?
Where did you find the new firmware? On github, the last commit was on Nov 18th.

Cheers,
Zoltán

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

Re: Timer example not working

Post by pythoncoder » Wed Dec 30, 2015 4:40 pm

Oh dear - sorry if I've caused you wasted time. :( I must admit my WiPy is sitting on a shelf pending firmware bugfixes.
Peter Hinch
Index to my micropython libraries.

Oli_
Posts: 15
Joined: Sun Nov 15, 2015 1:36 am

Re: Timer example not working

Post by Oli_ » Wed Dec 30, 2015 5:38 pm

v923z wrote:
pythoncoder wrote:I notice there's a new firmware build out today (29th Dec). Perhaps this might fix it?
Where did you find the new firmware? On github, the last commit was on Nov 18th.

Cheers,
Zoltán
You can find the last build of the Wipy firmware as this address : http://www.micropython.org/download/
It's nearly to the bottom of the page.
The direct link for today's build : http://micropython.org/resources/firmwa ... ff2dd2.zip

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

Re: Timer example not working

Post by pythoncoder » Fri Jan 01, 2016 7:44 am

To celebrate the new year I exhumed my WiPy from its sarcophagus and downloaded the latest (2016) firmware. I really don't enjoy being critical but alas even the first timer example fails:

Code: Select all

>>> from machine import Timer
>>> tim = Timer(4)
>>> tim.init(mode=Timer.PERIODIC)
>>> tim_ch = tim.channel(Timer.A, freq=2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid argument(s) value
So I guess my WiPy will be interred for a few more months in the hope of firmware which can at least run the demos. Or is it the documentation which is wrong?

@Danicampora The docs are confusing in that http://micropython.org/resources/docs/e ... neral.html directs users to https://github.com/wipy/wipy/releases for firmware rather than http://micropython.org/download/. The github site does seem long out of date.
Peter Hinch
Index to my micropython libraries.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Timer example not working

Post by Roberthh » Fri Jan 01, 2016 2:09 pm

For low frequencies/long periods, you have to use tim.channel(Timer.A | Time.B, freq=2). And yes, the documentation is somewhat concise, not telling when to use which. The example in the doc about registering a callback handler is also wrong. That's what misled me first. And I'm not sure whether the time module works well. But until now I had no real need to determine.
But besides this: Happy New Year.

v923z
Posts: 168
Joined: Mon Dec 28, 2015 6:19 pm

Re: Timer example not working

Post by v923z » Fri Jan 01, 2016 6:26 pm

Oli_ wrote: You can find the last build of the Wipy firmware as this address : http://www.micropython.org/download/
It's nearly to the bottom of the page.
The direct link for today's build : http://micropython.org/resources/firmwa ... ff2dd2.zip
Thanks, Oli! However, this raises another issue: if there is binary firmware that is newer than the latest commit on github, then github is obviously not the main platform for code development. I think this is really confusing, and hinders collaborative work. E.g., if I were to fix the timer code, I have no idea where I should get the source from.

I ordered the micropython board when it was announced on kickstart two years ago. In about a week, Damien released his source code, and made the work on the code extremely transparent, and exactly this is what makes the micropython project so lively. Based on this experience, I expected a similar attitude from the creators of wipy, especially, that wipy was staff picked on kickstart. I was obviously wrong.

Zoltán

v923z
Posts: 168
Joined: Mon Dec 28, 2015 6:19 pm

Re: Timer example not working

Post by v923z » Fri Jan 01, 2016 6:29 pm

pythoncoder wrote:Oh dear - sorry if I've caused you wasted time. :( I must admit my WiPy is sitting on a shelf pending firmware bugfixes.
Don't worry, no harm was done. ;)

Zoltán

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Timer example not working

Post by Roberthh » Fri Jan 01, 2016 7:08 pm

Besides the micropython.org download site for binaries, the whole source code including the versions for WiPy can be found here: https://github.com/micropython/micropython. The WiPy version is the one in folder cc3200.

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

Re: Timer example not working

Post by pythoncoder » Sat Jan 02, 2016 6:52 am

@Roberthh
the documentation is somewhat concise
That's a very diplomatic way to express it ;) I can handle "concise" but demos which don't actually work and links to outdated source code are profoundly offputting.

Thanks for the pointers. I'll try once again to make sense of the WiPy and its timers. Happy new year, everyone :)
Peter Hinch
Index to my micropython libraries.

Post Reply