CanBus to API

Post Reply
ioioio
Posts: 7
Joined: Sun Jan 04, 2026 9:53 pm

CanBus to API

Post by ioioio »

Hallo I am adapting my old code for Open Auto Pro to the Hudiy API.
This is a script that will read the canbus messages of the infotainment netwok, specifically the steeing wheel buttons, and pass the commands to the API.
https://pastebin.com/SAxuYfsx
I do get this error though

Code: Select all

Traceback (most recent call last):
  File "/home/io/Scripts/Canbus/hudiy-canbus.py", line 153, in <module>
    main()
    ~~~~^^
  File "/home/io/Scripts/Canbus/hudiy-canbus.py", line 140, in main
    client.connect('127.0.0.1', 44405)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/io/Scripts/Canbus/common/Client.py", line 114, in connect
    self._socket.connect((hostname, port))
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
ConnectionRefusedError: [Errno 111] Connection refused
SocketcanBus was not properly shut down
hudiy
Site Admin
Posts: 440
Joined: Mon Jul 14, 2025 7:42 pm

Re: CanBus to API

Post by hudiy »

Is Hudiy running when you execute the script? The stack trace suggests that nothing is listening on port 44405 (Hudiy isn't running).
ioioio
Posts: 7
Joined: Sun Jan 04, 2026 9:53 pm

Re: CanBus to API

Post by ioioio »

Ok that was dumb, got it now, I repost the script which had some errors, now it is fully working:
https://pastebin.com/fXfYNSTD
Post Reply