Giter VIP home page Giter VIP logo

Comments (11)

 avatar commented on June 13, 2024 1

maybe because running in python2 ?

try:
sudo python3 /home/pi/domoticz/scripts/python/AOK-AM43.py

from a-ok-am43-blinds-drive.

TheBazeman avatar TheBazeman commented on June 13, 2024

from a-ok-am43-blinds-drive.

roblomq avatar roblomq commented on June 13, 2024

To be sure, that means the "/A-OK_AM43_Blind_Drive/" folder is in the root of the pi, on the same level as the "home" folder for example? If yes, I already did that but gives the same error.

The service is running but is that needed for the script?

from a-ok-am43-blinds-drive.

dr-ni avatar dr-ni commented on June 13, 2024

yes - this solved the problem for me :-)

from a-ok-am43-blinds-drive.

TheBazeman avatar TheBazeman commented on June 13, 2024

Adjusted the readme and explained it to prevent this. I cannot program it because it is failing at pre-compiling within Python.

from a-ok-am43-blinds-drive.

roblomq avatar roblomq commented on June 13, 2024

Funny that this issue is closed because someone says it solved his issue while the topic starter didn't even test it yet.

from a-ok-am43-blinds-drive.

TheBazeman avatar TheBazeman commented on June 13, 2024

from a-ok-am43-blinds-drive.

roblomq avatar roblomq commented on June 13, 2024

When I run

sudo python3 /home/pi/domoticz/scripts/python/AOK-AM43.py

I get te following

` * Serving Flask app "AOK-AM43" (lazy loading)

  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
    Traceback (most recent call last):
    File "/home/pi/domoticz/scripts/python/AOK-AM43.py", line 252, in
    app.run(host='0.0.0.0') #Listen to all interfaces #,debug=True
    File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 990, in run
    run_simple(host, port, self, **options)
    File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 1052, in run_simple
    inner()
    File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 1005, in inner
    fd=fd,
    File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 848, in make_server
    host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
    File "/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py", line 740, in init
    HTTPServer.init(self, server_address, handler)
    File "/usr/lib/python3.7/socketserver.py", line 452, in init
    self.server_bind()
    File "/usr/lib/python3.7/http/server.py", line 137, in server_bind
    socketserver.TCPServer.server_bind(self)
    File "/usr/lib/python3.7/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
    OSError: [Errno 98] Address already in use
    `

from a-ok-am43-blinds-drive.

dr-ni avatar dr-ni commented on June 13, 2024

Is another server is still running?
try:
ps -fA | grep python
and post the result

from a-ok-am43-blinds-drive.

roblomq avatar roblomq commented on June 13, 2024

root 26673 1 21 20:43 ? 00:00:09 /usr/bin/python3 /home/pi/domoticz/scripts/python/AOK-AM43.py

So indeed you get this traceback if it is already running.
I've managed to get it working now and am trying to control it by Domoticz. I've got a question, is the service started up at a reboot or do I need to add a start command somewhere the service is started at boot.

from a-ok-am43-blinds-drive.

dr-ni avatar dr-ni commented on June 13, 2024

you need to start it
e.g. by cron:
sudo crontab -e
#add this:
@reboot /usr/bin/python3 /home/pi/domoticz/scripts/python/AOK-AM43.py > /dev/null 2>&1 &

or add this to /etc/rc.local before exit 0:
/usr/bin/python3 /home/pi/domoticz/scripts/python/AOK-AM43.py > /dev/null 2>&1 &

from a-ok-am43-blinds-drive.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.