[Microbit-Python] Lock-up due to some combination of radio and pwm.

Jim Mussared jim at groklearning.com
Fri Dec 30 21:43:43 EST 2016


Maybe related -- https://github.com/bbcmicrobit/micropython/issues/380

(Summary - if you're using the firmware image in Mu/uFlash as of a few
weeks ago, this may be already fixed)

On 30 December 2016 at 23:04, Mark Shannon <mark at hotpy.org> wrote:
> Hi Nevil and David,
>
> Could you please submit an issue for this.
> https://github.com/bbcmicrobit/micropython/issues/new
>
> It is frustrating knowing that there may be a problem, but not being able to
> fix it.
> All I need is a brief description of what goes wrong and, most importantly,
> some code that causes the problem.
>
> Cheers,
> Mark.
>
> On 23/12/16 18:44, Nevil Hunt wrote:
>>
>> Hi David,
>>
>>
>> I've also encountered some similar symptoms this week, namely a
>> micro:bit locking up such that a reset doesn't bring it back to life.
>> Only a power cycle brings it back to life.
>>
>>
>> My set-up has some similarities with yours in that I'm sending Radio
>> commands from one micro:bit to another using the suggested method of
>> "radio.send(str(x))" with the receiving micro:bit locking up from time
>> to time. However I think the lockups might not be due to the Radio
>> commands. I too have the receiving micro:bit driving pins with PWM (in
>> my case Servos) and with a bit of experimenting it looks like it might
>> be these "pin1.write_analog(x_angle)" commands that are causing the
>> lock-ups since by commenting out these "write_analog" commands (but with
>> all the Radio commands still running) it hasn't locked up in over an
>> hour. By comparison, with the "write_analog" commands still active, ~5
>> mins is the longest it runs without locking up.
>>
>>
>> Maybe you could see if commenting out the "write_analog" commands on
>> your setup has the same effects. It may not stop other errors but I'd be
>> interested to see if it stops the lock-ups.
>>
>>
>>
>> Cheers,
>>
>>
>> Nevil
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>> *From:* Microbit <microbit-bounces+nevil.hunt=hotmail.co.uk at python.org>
>> on behalf of David Booth via Microbit <microbit at python.org>
>> *Sent:* 23 December 2016 15:09
>> *To:* For Pythonic MicroBit related discussions
>> *Cc:* David Booth
>> *Subject:* Re: [Microbit-Python] List of error codes and their meanings
>>
>> Hi Damien
>>
>> I have a related question regarding run time errors in micro Python.
>>
>> I have three micro:bits. The first I call Rx because it basically
>> receives x axis acceleration data in string form, via the radio from the
>> other two micro:bits Tx1 and Tx2.  Rx poles Tx1 then Tx2 with 100 ms
>> gaps. Nicholas Tollervey showed me how to avoid the Type None error when
>> converting the string to an integer in RX and I now have three simple
>> script which enable Rx to drive pins P0 (from Tx1) and P8 (from Tx2)
>> with a PWM signal.
>>
>> However after running perfectly well for anything from 10 seconds to a
>> minute Rx freezes. On the very few occasions an error message has
>> scrolled it appears to be saying that "received is not a string" and
>> possibly there is a value error.  However on 98% of occasions Rx is
>> frozen to the extent it cannot report the error. Since spurious errors
>> do not worry me, provided Rx continues with the polling loop, is it
>> possible to suppress catching run time errors and if it is possible is
>> it likely that the While loop would continue?
>>
>> Sometimes pressing reset restarts the system but sometimes I have to
>> remove the battery.
>>
>> Thank you  and a Happy Christmas
>> David Booth
>> ps will you be at BETT?
>>
>>
>> On 20 December 2016 at 23:31, Damien George <damien.p.george at gmail.com
>> <mailto:damien.p.george at gmail.com>> wrote:
>>
>>     There are many exceptions and they can occur for many reasons.  Almost
>>     all are based on CPython and the exceptions form a hierarchy.  Eg,
>>     indexing a list with an out-of-bounds index will raise IndexError,
>>     which derives from LookupError, which derives from Exception, which
>>     derives from BaseException.
>>
>>     For a list of implemented exceptions in MicroPython see
>>
>> https://github.com/bbcmicrobit/micropython/blob/master/source/py/objexcept.c#L192-L280
>>
>> <https://github.com/bbcmicrobit/micropython/blob/master/source/py/objexcept.c#L192-L280>
>>
>>     On 21 December 2016 at 08:35, David Whale
>>     <david at thinkingbinaries.com <mailto:david at thinkingbinaries.com>>
>> wrote:
>>     > Is there anything in the docs that lists all the errors
>>     (exceptions) that
>>     > can occur in MicroPython and what they mean?
>>     >
>>     > The closest I found was this:
>>     >
>>     >
>>
>> https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h
>>
>> <https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h>
>>     >
>>     >
>>     > Thanks
>>     >
>>     > David
>>     >
>>     > microbit.org-ticket: 460
>>     >
>>     >
>>     >
>>     > _______________________________________________
>>     > Microbit mailing list
>>     > Microbit at python.org <mailto:Microbit at python.org>
>>     > https://mail.python.org/mailman/listinfo/microbit
>>     <https://mail.python.org/mailman/listinfo/microbit>
>>     >
>>     _______________________________________________
>>     Microbit mailing list
>>     Microbit at python.org <mailto:Microbit at python.org>
>>     https://mail.python.org/mailman/listinfo/microbit
>>     <https://mail.python.org/mailman/listinfo/microbit>
>>
>>
>>
>>
>> _______________________________________________
>> Microbit mailing list
>> Microbit at python.org
>> https://mail.python.org/mailman/listinfo/microbit
>>
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit


More information about the Microbit mailing list