Repair PYBD SF6W - Help please.

The official PYBD running MicroPython, and its accessories.
Target audience: Users with a PYBD
Post Reply
Stevo52
Posts: 38
Joined: Sun Feb 03, 2019 10:28 pm

Repair PYBD SF6W - Help please.

Post by Stevo52 » Thu Jul 16, 2020 10:34 am

After an enforced absence from PYBD prototyping, I have sat myself down while I have some time, with a few new little projects for a PYBD. I have previously developed some items using a SF2W on a WBUS DIP28 quite successfully (for my skill set). With new projects to work on, my first step was to fire up the old SF2W and check everything was working and it was all OK.

For the new project I used the DIP28 with Ext Batt (not connected) and fitted a new, unopened SF6W. Plugging the same USB cable into the existing DIP28 the SF6W came up to a green LED with a RED LED showing behind and the PC (W10 Pro) did not recognise the PYBD immediately but after a while it was but I was dismayed to have a 'You need to format the disk in Drive E before you can use it." pop up.

So, should I format it or is the alert a sign of a more serious problem with the SF6W. Of course I can't see the drive to check files and properties tells me o bytes used o bytes free and 0 bytes capacity and no Volume label. This is a new unused device, bought a few months back and still sealed with tape until today. I am experienced with electronic systems - devices are stored in ES bags and my work area is ES safe. I don't think I caused this problem.

What can I do? is this fixable and if so, what with and what is the procedure? Is a disk image required? Firmware update? I wouldn't be to happy to have to replace it without ever using it? I tried another PC, a different DIP28, different cables etc but all gave the same response for the SF6W but the SF2W was fine in the same setup each time.

Are there any 'tools' I can use - REPL doesn't work in any form that i have but I can get the board into Bootloader (White, Red flashing)) mode But the other Red/Green/Blue modes all end up at Green with Red showing behind.

I would really appreciate some advice on this, preferably in detailed step by step form as my memory is suffering a bit at present. Thanks in advance.

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

Re: Repair PYBD SF6W - Help please.

Post by pythoncoder » Thu Jul 16, 2020 12:51 pm

I wonder if it was sent out with incorrect firmware. I'd put it in DFU mode and upload the latest build. I have SF2W's and SF6W's and both behave similarly in a DIP28 so something sounds wrong. But the fact that you can get it into DFU mode suggests it is running code so hopefully the hardware is working.

Alternatively you could ignore the USB MSC mode and see if you can connect with rshell.
Peter Hinch
Index to my micropython libraries.

Stevo52
Posts: 38
Joined: Sun Feb 03, 2019 10:28 pm

Re: Repair PYBD SF6W - Help please.

Post by Stevo52 » Thu Jul 16, 2020 10:48 pm

Thanks for the response. An odd situation I encountered yesterday and I was stumped, so relaxed with a good book then a good sleep. Woke up this morning to a lovely but brisk new day :) After breakfast and a cuppa I sat down at my workbench for another look at the problem.

With no changes to the hardware set up from yesterday, I tried the SF2W first to check out the setup, all OK including running various code projects. So I fitted the SF6W and powered on - lo and behold, there were no errors and I could see the pyboard flash drive as a USB quite OK! I tried swapping the MCU's several time and everything worked OK no matter what I tried. Is it all fixed? hard to say - I don't like not knowing what caused the problems yesterday, maybe the SF6W just being truculent after being shut in a light-less box for some months! (MCU lives matter too :D ?).

I will keep working on the SF6W through the day and see how it goes.... I will update firmware on both devices too, seems prudent.

As I'm using Atom at present, I think I might move to rshell which seems to be popular with users here. Python 3.8 is installed already so just need to get rshell installed.

Stevo52
Posts: 38
Joined: Sun Feb 03, 2019 10:28 pm

Re: Repair PYBD SF6W - Help please.

Post by Stevo52 » Sat Jul 18, 2020 6:58 am

So some good news, the SF6W is OK and I have been writing and running code on it OK.

Some bad things though -

1. updating the SF2W and SF6W to a fresh download of PYBD-SF2-20191220-v1.12.dfu and PYBD-SF6-20191220-v1.12.dfu respectively, using an elevated PowerShell and then dfu-util-static went OK but when I run the previously working code:
a. I get a message telling me that uasyncio module doesn't exist when I try to import it - this is fine on the previous firmware, so do I have to load that module independently now? (I am not currently using uasyncio but was planning to).
b. get a similar message with ntptime (which I do use)? How do I get that module with the new firmware?
P.S. I have not yet done any custom firmware builds but this may be the time to learn?

Have I got the right versions of firmware as shown on https://micropython.org/download/pybd/, or should I be using the mboot versions? I would rather not to use unstable versions at this stage.

For now I have reverted to the previous firmware, so I can code, and the same code runs on either pybd. But I am wondering why these two modules (and there could be others) have been removed from the updated versions? or is it naming issues? It might require custome code for each firmware version going forward.

Using Atom as the REPL (with pymakr package) gives rise to some issues with the REPL I think. I am coding in Notepad++ which I am OK with but the Atom REPL is awkward to say the least and causes errors being detected in the code when started and stopped from there. Errors include variables not found, modules not being found etc. A complete reboot fixes things for a while then they reoccur.

So I thought, a good time to switch to rshell, but I have had no luck. I have Python 3.8 but trying to run pip install rshell in an elevated instance, with or without the sudo prefix, returns a syntax error with an arrow under the first letter of the second word in the command. What am I doing wrong?

Apologies for the long post, but I wanted to explain as clearly as possible the issues I am encountering.

Thanks in advance for any help. Steve W

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

Re: Repair PYBD SF6W - Help please.

Post by pythoncoder » Sat Jul 18, 2020 8:58 am

For uasyncio V3 you need to use the latest daily build ("unstable") version. MicroPython is subject to extensive automated testing. Problems with daily builds are extremely rare.

The ntptime.py file is in ports/esp8266/modules. From a very quick check it seems to work on Pyboard D - just copy it to your filesystem.

Re rshell I use pip3 install rshell.
Peter Hinch
Index to my micropython libraries.

Stevo52
Posts: 38
Joined: Sun Feb 03, 2019 10:28 pm

Re: Repair PYBD SF6W - Help please.

Post by Stevo52 » Sat Jul 18, 2020 9:27 am

Thanks Peter,

I will try those options tomorrow on one device. I appreciate the daily builds are tested, but "unstable" versions are subject to changes in my experience, adversely affecting any existing code. I have enough trouble sorting out my own code, without trying to figure out someone elses!

RShell
Using pip3 gives me the same error - arrow under the install word.. and syntax error. Maybe my Python install isn't correct - I am using Python 3.8 on Windows 10 Pro. I will use PuTTY for now..

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

Re: Repair PYBD SF6W - Help please.

Post by pythoncoder » Sun Jul 19, 2020 8:40 am

Until V1.13 is released, the only option for uasyncio V3 is a daily build or to build yourself, which amounts to the same thing. I have been using this very heavily, porting my libraries to uasyncio V3. In my view the codebase on STM and uasyncio are very stable. If you look on GitHub you'll see the areas under active development - mainly bluetooth, ESP32 and other platforms.

I'm afraid I can't help with Windows.

Code: Select all

pip3 install rshell
works on Linux.
Peter Hinch
Index to my micropython libraries.

Stevo52
Posts: 38
Joined: Sun Feb 03, 2019 10:28 pm

Re: Repair PYBD SF6W - Help please.

Post by Stevo52 » Sun Jul 19, 2020 11:19 am

I reinstalled Python 3.8 and pip worked and rshell is now installed. Unfortunately I do other work that needs Windows, so I have to use that platform - not without some problems though. Thanks for your help though.

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: Repair PYBD SF6W - Help please.

Post by rcolistete » Sun Jul 19, 2020 2:19 pm

You can use :
- Windows Subsystem for Linux (WSL);
- Linux in virtual machine;
- dual boot with Linux.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

Post Reply