uPyEasy unix port on Raspberry Pi

Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM

Post Reply
Message
Author
AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

uPyEasy unix port on Raspberry Pi

#1 Post by AndrewJ » 08 Feb 2018, 12:46

Encouraged by @Edu.Uy's success, I decided to give it a go myself, as I have a Raspi3 available (running my Home Assistant system) and it should give me a way of combining easy development of the OpenHAB MQTT protocol with available "live" data.

All has gone well up to the point of starting upyeasy (using ./micropython -m upyeasy as before). It creates the file structure ok, but then hits a series of errors which look to me like a problem with the db. My log is below...

Code: Select all

pi@homeassistant:~/micropython/ports/unix $ ./micropython -m upyeasy
loaded sink log
loaded sink console
loaded sink syslog
2018-02-08T11:39:56.003 [debug] uPyEasy: Init: Init constructor
2018-02-08T11:39:56.003 [debug] uPyEasy: Init: Entering init
2018-02-08 11:39:56 [debug] uPyEasy: Init: Create directory config
2018-02-08 11:39:56 [debug] uPyEasy: Init: Create directory plugins
2018-02-08 11:39:56 [debug] uPyEasy: Init: Create directory protocols
2018-02-08 11:39:56 [debug] uPyEasy: Init: Create directory scripts
2018-02-08 11:39:56 [debug] uPyEasy: Init: Create directory rules
2018-02-08 11:39:56 [debug] uPyEasy: Init: config Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: network Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: protocol Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: controller Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: hardware Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: dxpin Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: dxmap Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: plugin Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: pluginstore Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: device Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: service Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: notification Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: advanced Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: script Table
[Errno 17] EEXIST
2018-02-08 11:39:56 [debug] uPyEasy: Init: rule Table
[Errno 17] EEXIST
Traceback (most recent call last):
  File "upyeasy/__main__.py", line 64, in <module>
  File "upyeasy/__main__.py", line 40, in main
  File "upyeasy/init.py", line 158, in init
  File "upyeasy/db.py", line 43, in public
AttributeError: type object 'configTable' has no attribute 'get'
It looks like the database has already created the tables (on earlier attempts when I was hitting other errors with missing modules). How to get back to a clean start? :?:
Andrew

User avatar
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Re: uPyEasy unix port on Raspberry Pi

#2 Post by micropet » 08 Feb 2018, 14:26

Hello,
there you are already further than me.
I get:


root @ pi160:/opt/micropython/ports/unix # ./micropython -m upyeasy
Traceback (most recent call last):
   File "upyeasy / __ init__.py", line 14, in <module>
   File "upyeasy / core.py", line 30, in <module>
ImportError: no module named 'os'

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: uPyEasy unix port on Raspberry Pi

#3 Post by AndrewJ » 08 Feb 2018, 15:50

Hello, @micropet,
I got that error, and a number of others, at an earlier stage before I sent my message. I was advised by another forum member, @Edu.Uy, of the solution, which is to exit from micropython/upyeasy back to ~/micropython/ports/linux $, and type

Code: Select all

./micropython -m upip install micropython-<module_name>
(You may get it saying upip is not found when you do it the first time, in which case apt-get install upip,)

Then try again

Code: Select all

./micropython -m upyeasy
and you may get a different error.

I had a series of about 8-10 missing modules, it's a matter of working through them until it has all it needs.
One which was a bit peculiar was a module named "re" (regular expression). I tried the same approach as above, and it appeared to install, but micropython still complained that the module was not found. Edu advised using re-pcre instead, and that worked.

Hope this works for you! :)
And, if you don't get the error I'm having, please let me know how to avoid it!! ;)
Andrew

User avatar
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Re: uPyEasy unix port on Raspberry Pi

#4 Post by micropet » 08 Feb 2018, 17:50

Many Thanks. Again a little further.
Lisa makes it very difficult for us.

I'm stuck with onewire:


  ./micropython -m upip install micropython-onewire
Installing to: /root/.micropython/lib/
Warning: pypi.python.org SSL certificate is not validated
Error installing 'micropython-onewire': package not found, packages may be partially installed

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: uPyEasy unix port on Raspberry Pi

#5 Post by AndrewJ » 08 Feb 2018, 18:06

For _onewire, please refer to this message which has a zip file attached...
viewtopic.php?f=23&t=4774#p24221
HTH
Andrew

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests