Spanni26 / pyHPSU

Python Script to read and send commands to a Rotex HPSU
26 stars 15 forks source link

Help needed (can0) #42

Closed KalaNagHTD closed 3 years ago

KalaNagHTD commented 3 years ago

I use pyHPSU on a Pi with Canpi 2. After the first setup it worked fine. But now I found that it stopped working. Don't know what I've done wrong. Whenever I try to retrieve CAN data I get the following message now:

error_message

With "ifconfig" the can0 does not show up anymore!

With "dmesg" I find the following lines: dmesg1 dmesg2

Any advice is highly appreciated!

Karl

Spanni26 commented 3 years ago

Am 06.03.2021 um 09:14 schrieb KalaNagHTD:

I use pyHPSU on a Pi with Canpi 2. Whenever I try to retrieve CAN data I get the following message

error_message https://user-images.githubusercontent.com/77481230/110200007-c78d9300-7e5b-11eb-9954-f43a79fa8a57.jpg

With "ifconfig" the can0 doesn't show up

With "dmesg" I find the following lines: dmesg1 https://user-images.githubusercontent.com/77481230/110200056-28b56680-7e5c-11eb-9695-32a981cafced.jpg dmesg2 https://user-images.githubusercontent.com/77481230/110200060-2c48ed80-7e5c-11eb-9f2d-eb95ae007d26.jpg

Any advice is highly appreciated!

Hi Karl,

which distribution are you using? You have to set up a con device first.

Regards

Daniel

KalaNagHTD commented 3 years ago

Hi Daniel

sorry, with respect to my rookie level I need to have your question and advice a little more detailed. Could you be so kind?

I've set up Python two weeks ago. So it should be the most recent version.

Karl

martinbischofff commented 3 years ago

Hi Karl.

Are you talking about PiCAN2? In your post you mentioned Canpi 2 which I can't find.

If you're actually using PiCAN2, did you follow the steps in the software installation manual? https://www.skptechnology.co.uk/pican2-software-installation/

Regards Martin

KalaNagHTD commented 3 years ago

Hi Martin.

Sorry for the missprint: I use PICAN2! I set it up as described in the manual mentioned above. But I couldn't get the can-tools working.

The distribution I use is Raspbian 10 (buster)

Regards Karl

KalaNagHTD commented 3 years ago

I initialized can0 again and found the following lines with ifconfig now:

ifconfig

Nevertheless the error messages remain the same.

KalaNagHTD commented 3 years ago

...and after a reboot the can0 lines in the ifconfig have disappeared again :-(

KalaNagHTD commented 3 years ago

Success! After a power reset of my raspi and again initializing the can0 it seems to work. I learned what I should have known: A soft reboot is not enough...

Thanks to both of you for your support! Issue can be closed!

Karl

KalaNagHTD commented 3 years ago

Wichtiger Nachtrag: Bei mir fehlten die in Python sehr wichtigen Einrückungen der letzten drei Zeilen im folgenden Code:

auto can0 iface can0 inet manual ....pre-up /sbin/ip link set $IFACE type can bitrate 20000 triple-sampling on ....up /sbin/ifconfig $IFACE up ....down /sbin/ifconfig $IFACE down