Notifications
Clear all

Error Compiling with Arduino IDE 2.0.3

17 Posts
4 Users
1 Reactions
1,228 Views
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1040
Topic starter  

I'm attempting to compile Bill's "picow-wifi-station.ino" using the Arduino 2.0.3 IDE.  I have the Raspberry Pi Pico W selected as my board but I'm getting the following compilation error when I try to compile the code.

Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

What seems very strange to me is the error says "Fatal Python error" even though I'm compiling with the IDE which used C++

Where have I gone wrong?

SteveG


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7402
 

Posted by: @codecage

I'm attempting to compile Bill's "picow-wifi-station.ino" using the Arduino 2.0.3 IDE.  I have the Raspberry Pi Pico W selected as my board but I'm getting the following compilation error when I try to compile the code.

Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

What seems very strange to me is the error says "Fatal Python error" even though I'm compiling with the IDE which used C++

Where have I gone wrong?

Python is used to perform several steps of the build, if you have verbose output enapbled you will see them. I have never seen that error on the forum but my supicion is something is messed up in your IDE and core library installation. The easiest fix is to just do a re-install of 2.0.3 but it is also possible that your python environment got messed up. I know almost nothing about python but reading some github convos tells me there was a period recently where the python team caused a serious problem and many workarounds were done but mow with the 3.x version out it should be good unless of course you did one of the workarounds that is more permanent. Hopefully this gives you a clue. Good luck.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Kids Taxi
(@kids-taxi)
Member
Joined: 4 years ago
Posts: 13
 

@codecage

Hi codecage,

You might want to post your query on the MicroPython forums.  I'm not wanting to detract from this forum  at all however I was looking for information and subscribed for 2 and a half days during which I got almost 300 emails about posts.  It's very active, I've unsubscribed now.

Non Sibi Sed Omnibus


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7402
 

@kids-taxi FYI @codecage He isn't using MicroPython, the Arduino IDE uses Python to do utility tasks.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@codecage

Posted by: @codecage

I'm attempting to compile Bill's "picow-wifi-station.ino" using the Arduino 2.0.3 IDE.  I have the Raspberry Pi Pico W selected as my board but I'm getting the following compilation error when I try to compile the code.

Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

What seems very strange to me is the error says "Fatal Python error" even though I'm compiling with the IDE which used C++

Where have I gone wrong?

Hi Steve, tried to replicate your problem, but all worked OK for me under Win10.

I specifically installed the pico board and tested the blink sketch as per Bill's video here and all worked fine for me.

Please get the blink sketch as per Bill's article first 😉

I am using the latest nightly builds 2.04, so not sure if that may be a factor.

I did do some research, and found the following information to this error may be helpful to you, though not necessarily tied to Arduino - This appears to be a common error.

Good luck and Cheers!


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1040
Topic starter  

@frogandtoad 

Thanks loads for attempting to replicate my error!  Originally I had done the blink sketch and all was right with the world.  That was about all I did before setting the Pico W aside for awhile.  But now that I'm back to playing around with the Pico I have encountered this error.  I'm now convinced I have an issue somewhere in my libraries.  I tried uninstalling the 2.0.3 IDE and reinstalling, but to no avail.  I now need to figure out what library is the issue.  Interestingly enough I get the same error, plus a few more, if I try to compile using the 1.8.13 IDE.

This is occurring on my Win10 laptop, so as soon as I can I'm going to give it a shot on the dual boot NUC I put together using Bill's video.  Haven't done much Arduino work on that machine, or even installed the Pico libraries, so maybe it'll work OK there.  Will post an update to all that have responded here once I give that a shot.

Again, thank you for looking into this issue! 

SteveG


   
frogandtoad reacted
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@codecage

Posted by: @codecage

@frogandtoad 

Thanks loads for attempting to replicate my error!  Originally I had done the blink sketch and all was right with the world.  That was about all I did before setting the Pico W aside for awhile.  But now that I'm back to playing around with the Pico I have encountered this error.  I'm now convinced I have an issue somewhere in my libraries.  I tried uninstalling the 2.0.3 IDE and reinstalling, but to no avail.  I now need to figure out what library is the issue.  Interestingly enough I get the same error, plus a few more, if I try to compile using the 1.8.13 IDE.

This is occurring on my Win10 laptop, so as soon as I can I'm going to give it a shot on the dual boot NUC I put together using Bill's video.  Haven't done much Arduino work on that machine, or even installed the Pico libraries, so maybe it'll work OK there.  Will post an update to all that have responded here once I give that a shot.

Again, thank you for looking into this issue! 

No worries, Steve.

Hope you get it sorted, please let us know how it goes.

Cheers


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7402
 

@codecage I think the errors you showed were python related. My knowledge is sketchy but I have read that there were python issues when they went from 2.x to 3.x. It did not go well but now is (mostly) settled. You may have some remnants of that and I do not know the solution other than maybe make sure your python environment is correct and at 3.x.

YES, python tools are used even in the C++ environment by the IDE. Try re-installing the IDE, but I have a hunch that may not fix your issue. If not, a little googling may help and maybe a fresh python 3 install will do the job. Good luck.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1040
Topic starter  

@zander 

Thanks for the advice, much appreciated.  I have reinstalled the IDE and Python and still get the error on my laptop.  I'm thinking it has to be a library problem.  I have an Intel NUC that I have not used for the PICO W yet so I'm going to do a little experimenting on it, but it might have to wait until after the New Year with all that is going on around my household.

All the best to you and yours for the Holidays!

SteveG


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7402
 

@codecage Do you have verbose enabled in your prefs? If not then what you didn't notice is the following during a compile of a PICOW sketch. There are many python tools used by the gnu build system. A search on python in the Arduino15 folder yields 4,702 results.

Screenshot 2022 12 19 at 09.26.55

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7402
 

@codecage Understood. I recall I encountered one of those python errors a while ago and it took me a long time to unwind it. A re-install didn't do it I had to use alias, rename, maybe a few other tricks until I stumbled on the right solution. So very sorry I don't remember what it was, but it was definitely a python issue not a library issue. Good luck. All the best to you and yours!

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Kids Taxi
(@kids-taxi)
Member
Joined: 4 years ago
Posts: 13
 

@codecage

Hi codecage,

I’m going to apologize to Ron now for mentioning a ‘pure Python fix’ as a test to make sure that the WiFi chip is ok but as I’ve already posted it you only have to read it link is below. Note that it was a very late night fix for the part1 which continued later the same day. It will get you connected if the chip is ok.

https://forum.dronebotworkshop.com/2022-videos/pico-w-with-arduino-ide/paged/2/#post-36207

As for the second part of this post, Ive sorted out the Board manager and installed the correct one on the new 2.0.3 IDE Arduino system. I was using a PicoW that I’ve been using with Pimoroni’s Display_2 for about a month and that has been used to check that the pure Python fix actually worked.

Even so the New Arduino IDE had issues connecting to the PicoW. When the USB’s are connected and the correct board selected it does not open a port. It took a while scratching my head before I realized that it takes over a minute to cycle up to 37 (counter in the bottom left border) to get a connection sorted out. Then I could not get the ‘Blink’ sketch to upload.

After several attempts at both problems I noticed that the compile action was creating a “uf2” file, it was creating both the support function and the program it was going to run in that file. I then understood why it was taking so long to produce such a short file, it was compiling many files not just that one.

As it was providing everything to make it run I used the boot select to allow the IDE to write to the PicoW, instant led blinking.

I used the same process for the Web Scanning program with no problems.

Just so you have everything I know about thsi (in the unlikely case that these don’t work) there are 2 issues being addressed on GitHub in the MicroPython forum (with one of these also being discussed on the RPi forum Pico section.) One to do with using pin 25 incorrectly and the other to do with forcing a key to be provided to access the web.)

I hope this helps

Good Luck

Non Sibi Sed Omnibus


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7402
 

@kids-taxi I am not certain from your reply, but have you done the one time initial action so that the PICO acts the same as an arduino? Can you now upload a sketch and it works the same as an arduino?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Kids Taxi
(@kids-taxi)
Member
Joined: 4 years ago
Posts: 13
 

I forgot to say that you might want to use PicoProbe and FlashNuke as a last resort

https://datasheets.raspberrypi.com/soft/picoprobe.uf2

https://datasheets.raspberrypi.com/soft/flash_nuke.uf2

Non Sibi Sed Omnibus


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7402
 

@kids-taxi What will they do?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Page 1 / 2