Help needed with Micropython

Moderators: odroid, mdrjr

Help needed with Micropython

Unread postby SupaaSchnitzel » Mon Aug 13, 2018 9:42 am

Hello Odroid Forum users,
I have the following problem:
When I try to use rsync to sync the ODROID-GO module with my Odroid go I get the error/ message in my terminal:
Adding /pyboard/odroid_go
Unable to create /pyboard/odroid_go
Adding /pyboard/boot.py
timed out or error in transfer to remote

I have no problem connecting to the device with
rshell -p /dev/ttyUSB0
and i have checked, my device is plugged into USB0.
I am using the firmware version 20180806-4983b77858 and I downloaded the newest Micorpython.fw firmware from OtherCrashOverride Git.
The system i am running is linux mint.
I appreciate the help and if you need any more information please let me know
Greetings
Schnitzel
SupaaSchnitzel
 
Posts: 2
Joined: Mon Aug 13, 2018 9:33 am
languages_spoken: english, german
ODROIDs: Odroid go

Re: Help needed with Micropython

Unread postby NickTulett » Mon Sep 24, 2018 4:16 am

I had this problem as well.

Firstly you need to edit odroid_go.py and utils/button/button.py to comment out all the Pin.PULL_UP parameters, e.g.
Code: Select all
Pin(BUTTON_JOY_X_PIN, Pin.IN)#, Pin.PULL_UP)

several times in odroid_go.py
and
Code: Select all
self._pin = Pin(pin, Pin.IN)#, Pin.PULL_UP)

in button.py

Otherwise the boot.py will not run.


After that, run the rsync command, but to /flash NOT /pyboard
NickTulett
 
Posts: 1
Joined: Mon Sep 24, 2018 4:10 am
languages_spoken: english
ODROIDs: GO

Re: Help needed with Micropython

Unread postby joshua.yang » Thu Oct 04, 2018 12:28 pm

Hi.
Sorry to late reply.

I've just tested with OtherCrashOverride's MicroPython firmware and caught that the odroid_go.py module isn't compatible with this.

I think the reason is that OtherCrashOverride's is based on LoBo's firmware and the Wiki's is based on MicroPython official firmware.
They're different from each other. Might have different modules, functions, properties...
I don't know how exactly differs(Need to see deeply but not yet) but do know they're just almost same not the exact same. Seems LoBo's also based on official MicroPython source but some modifications applied: https://github.com/OtherCrashOverride/M ... icropython

That's why odroid_go.py doesn't work well and why it even doesn't be uploaded to ODROID-GO device via rshell tool.

So I would like to tell you guys 2 suggestions to use MicroPython.
1. Use MicroPython's official firmware for a while rather than OtherCrashOverride ports although the firmware overwrites whole memory includes the launcher. That would work like a charm on ODROID-GO with odroid_go.py. Follow the Wiki guide from the scratch.
2. Follow NickTulett's method. Seems LoBo's doesn't support the third parameter for PULL mode for Pin function.
joshua.yang
 
Posts: 107
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: English
ODROIDs: XU4, XU4Q + Cloudshell2

Re: Help needed with Micropython

Unread postby crashoverride » Thu Oct 04, 2018 4:03 pm

The "LoBo" fork of Micropython was chosen based on two main factors at the time:
1) It was the only offering supporting PSRAM at the time.
2) It was patched to allow using a SD card and LCD that share the same SPI bus.

[edit]
I do not maintain Micropython. I only packaged it into a .fw file for ease of use.
crashoverride
 
Posts: 4130
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Help needed with Micropython

Unread postby joshua.yang » Thu Oct 04, 2018 5:31 pm

Okay, I'm supposed to update for the compatibility. :)
Actually It's been needed. Starting MicroPython using the launcher is easy to use.

I'll update odroid_go.py module and the Wiki guide soon.
joshua.yang
 
Posts: 107
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: English
ODROIDs: XU4, XU4Q + Cloudshell2

Re: Help needed with Micropython

Unread postby joshua.yang » Wed Oct 10, 2018 3:18 pm

Hi all.

I've updated our MicroPython GO module for Loboris' fork and our Wiki page.
Loboris' firmware has much more things than official one so I decided to refactor the code and create a new branch for it.

Thanks to its included modules, there're 2 noticeable changes on GO module.
- More functions for LCD, and performance optimized hugely.
- ADC.read() now calibrates its raw value automatically, so I could add get_percentage() function for battery.
And, as you may see on the Wiki page linked below, much more things now seem to be available such as Web server, SSH, ... Very interesting.

Please check.
Wiki: https://wiki.odroid.com/odroid_go/micro ... up_loboris
Loboris' MicroPython Wiki: https://github.com/loboris/MicroPython_ ... _LoBo/wiki
Github: https://github.com/hardkernel/ODROID-GO ... ee/loboris
joshua.yang
 
Posts: 107
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: English
ODROIDs: XU4, XU4Q + Cloudshell2

Re: Help needed with Micropython

Unread postby einstein » Sun Oct 14, 2018 12:23 am

joshua.yang wrote:Hi all.

I've updated our MicroPython GO module for Loboris' fork and our Wiki page.
Loboris' firmware has much more things than official one so I decided to refactor the code and create a new branch for it.

Thanks to its included modules, there're 2 noticeable changes on GO module.
- More functions for LCD, and performance optimized hugely.
- ADC.read() now calibrates its raw value automatically, so I could add get_percentage() function for battery.
And, as you may see on the Wiki page linked below, much more things now seem to be available such as Web server, SSH, ... Very interesting.

Please check.
Wiki: https://wiki.odroid.com/odroid_go/micro ... up_loboris
Loboris' MicroPython Wiki: https://github.com/loboris/MicroPython_ ... _LoBo/wiki
Github: https://github.com/hardkernel/ODROID-GO ... ee/loboris



Great work. Would it be possible to extend the Lcd class by a few convenience methods (like print and write of the 'master' branch)?

Btw, it would be great to create a new topic "MicroPython Coding Camp" and move all related stuff over there.
User avatar
einstein
 
Posts: 29
Joined: Sat Apr 13, 2013 11:29 pm
languages_spoken: english, german
ODROIDs: ODroid-X2

Re: Help needed with Micropython

Unread postby joshua.yang » Mon Oct 15, 2018 1:49 pm

einstein wrote:Great work. Would it be possible to extend the Lcd class by a few convenience methods (like print and write of the 'master' branch)?

Thanks.

I totally agree with print and write functions are easy to use. As you know, Loboris fork needs setting absolute location in (x, y) form when using text function.
But it seems not too difficult to implement them. I'll give it a shot soon. :)


einstein wrote:Btw, it would be great to create a new topic "MicroPython Coding Camp" and move all related stuff over there.

(Partly) Agreed, but, it seems there wouldn't be enough users for now. But someday there would be. ;)
joshua.yang
 
Posts: 107
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: English
ODROIDs: XU4, XU4Q + Cloudshell2

Re: Help needed with Micropython

Unread postby SupaaSchnitzel » Mon Oct 15, 2018 5:11 pm

Hi again,
sry for the really late reply :) I had some stuff going on with uni that kept me busy, oh well.
I just wanted to thank you all for the help, i got it working now which is super great.
Special thanks to you joshua, your method worked like a charm.
SupaaSchnitzel
 
Posts: 2
Joined: Mon Aug 13, 2018 9:33 am
languages_spoken: english, german
ODROIDs: Odroid go

Re: Help needed with Micropython

Unread postby einstein » Tue Oct 16, 2018 2:17 am

joshua.yang wrote:
einstein wrote:Great work. Would it be possible to extend the Lcd class by a few convenience methods (like print and write of the 'master' branch)?

Thanks.

I totally agree with print and write functions are easy to use. As you know, Loboris fork needs setting absolute location in (x, y) form when using text function.
But it seems not too difficult to implement them. I'll give it a shot soon. :)


einstein wrote:Btw, it would be great to create a new topic "MicroPython Coding Camp" and move all related stuff over there.

(Partly) Agreed, but, it seems there wouldn't be enough users for now. But someday there would be. ;)


That is right. However, if MicroPython would be presented more prominently (e.g. directly under "Arduino..."), more people would get aware of programming possibilities other than Arduino. Btw, I got the WeatherBoard 2 working with MicroPython and wrote a Weather Station program like the one of the Arduino Coding Camp wiki. Once ported to the loboris way of writing to the LCD, I could post the code. I am doing some other stuff as well, like an extended boot.py that starts the WiFi interface of the ESP32 and synchronizes the RTC with an NTP server. Needed data for that is read from a config file.
User avatar
einstein
 
Posts: 29
Joined: Sat Apr 13, 2013 11:29 pm
languages_spoken: english, german
ODROIDs: ODroid-X2

Re: Help needed with Micropython

Unread postby joshua.yang » Tue Oct 16, 2018 3:46 pm

SupaaSchnitzel wrote:Hi again,
sry for the really late reply :) I had some stuff going on with uni that kept me busy, oh well.
I just wanted to thank you all for the help, i got it working now which is super great.
Special thanks to you joshua, your method worked like a charm.

Happy to hear that. :)


einstein wrote:That is right. However, if MicroPython would be presented more prominently (e.g. directly under "Arduino..."), more people would get aware of programming possibilities other than Arduino.

You're right. We will decide after internal discussion. ;)


einstein wrote:Btw, I got the WeatherBoard 2 working with MicroPython and wrote a Weather Station program like the one of the Arduino Coding Camp wiki. Once ported to the loboris way of writing to the LCD, I could post the code. I am doing some other stuff as well, like an extended boot.py that starts the WiFi interface of the ESP32 and synchronizes the RTC with an NTP server. Needed data for that is read from a config file.

Great job! I think all of the applications except some games could be ported to MicroPython, perhaps even with some upgrades by you.
joshua.yang
 
Posts: 107
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: English
ODROIDs: XU4, XU4Q + Cloudshell2

Re: Help needed with Micropython

Unread postby mad_ady » Tue Oct 16, 2018 3:50 pm

Sorry to but in, but MicroPython would benefit from an on-screen launcher. When you start it you should be able to use the LCD/keys to select a script on the SD card and start that. That would lower the bar and make it easier to use (no serial needed).
User avatar
mad_ady
 
Posts: 4863
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Help needed with Micropython

Unread postby einstein » Wed Oct 17, 2018 1:58 am

mad_ady wrote:Sorry to but in, but MicroPython would benefit from an on-screen launcher. When you start it you should be able to use the LCD/keys to select a script on the SD card and start that. That would lower the bar and make it easier to use (no serial needed).


Something like that is my ultimate goal. At the moment I am getting acquainted with programming the GO with MicroPython. As an experienced Python programmer (doing the eric Python IDE since 2002) one has to get used to the limited MicroPython. Nevertheless, it is really fun.
User avatar
einstein
 
Posts: 29
Joined: Sat Apr 13, 2013 11:29 pm
languages_spoken: english, german
ODROIDs: ODroid-X2

Re: Help needed with Micropython

Unread postby joshua.yang » Wed Oct 17, 2018 2:55 pm

For certain reasons, I think Loboris MicroPython fork is much better than the official one, that is not only just easy-to-use on a device itself but also it comes with many of useful modules and functions which is even more optimized for ESP32.
So I agreed too. :)

Actually one fact I really had worried about is that display performance is too slow with MicroPython. I searched many of the libraries for ILI9341 LCD but couldn't find well-suited one, for some reasons. But with Loboris fork, all of my worries could be gone. Just works like a charm than I expected.
joshua.yang
 
Posts: 107
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: English
ODROIDs: XU4, XU4Q + Cloudshell2


Return to General Chat

Who is online

Users browsing this forum: No registered users and 6 guests