looks like I have no chance to get working
Python Scripts - Home Assistant (home-assistant.io)
implement it doesn’t look so complicated. Create folder, copy py file and call with parameters…
Are you able help me with it ?
looks like I have no chance to get working
Python Scripts - Home Assistant (home-assistant.io)
implement it doesn’t look so complicated. Create folder, copy py file and call with parameters…
Are you able help me with it ?
Can you send me a python for sending data to a port and receiving answer?
You have Python code for getting the answer, it is posted above. It is the serial code. Granted as I said it has limited logger statements for debugging, but it is right there. You could edit the code, add additional debugging code, swap the code into your install and restart and get more log messages.
in case your missed it:
But I suspect you think things work differently than you expect. You cannot have other devices grabbing the transmission port and expect it to be released. Your saying things like other “dongles” and connections and running stuff and that is all band aids that could be causing additional problems you do not realize.
Start fresh, other the devices you expect attached. Debug. I see no messages about creating the connection or anything other than “hey I found /etc/usb0” … no sends, no receives no nothing. Hard to believe unless something else is not working.
No I don’t have other device using same dongle. This dongle is only for HA. Second dongle is connected to the PC. Both dongles are USB/RS485 - on the RS485 you can have connected more devices:
I copied complete code and started from debug :
I tried make a simple python script for serial port definition :
import serial
ser = serial.Serial(port='/dev/ttyACM0', baudrate=9600, bytesize=8, parity='N', stopbits=1)
if ser.is_open:
logger.info("port open success")
else:
logger.info("port open failed")
but there is a error :
2022-09-04 12:11:36.532 ERROR (SyncWorker_1) [homeassistant.components.python_script.hello_world.py] Error executing script: import not found
I also tried to start node red and get a error 502 Bad gateway!!!