question

nebulight avatar image
nebulight asked

Help with Raspberry Pi with Expander Pi (for RTC and tank levels)

I got my expander pi for the RTC and tank level ADC. I'm trying to follow the directions to get the ADC working, but I'm stuck. https://groups.google.com/forum/#!searchin/victron-dev-venus/expander$20pi%7Csort:date/victron-dev-venus/V-JKXfBxXbA/-4kUe5qVFgAJ

https://gist.github.com/aaronsb/3a8de2bfc6081ecda268a353125bae14

I followed this:


#copy dtb to /u-boot/overlays I DID THIS FROM THE DOWNLOADED FILE

#excerpt from post:

#I had to convert the mcp3008-overlay.dtb to a dts file, change all references to 3008 to 3208, and convert it back to a dtb file, to get it to give me 12-bits (4095).

#(I've enclosed the dtb file if anyone needs it). The line in config.txt should read "dtoverlay=mcp3208:spi0-0-present" I DID THIS



#https://groups.google.com/d/msg/victron-dev-venus/mejgJbMjU34/WglmnUPQAwAJ


opkg install kernel-module-mcp320x I DID THIS

chmod 755 /opt/victronenergy/dbus-adc/start-adc.sh I get chmod: /opt/victronenergy/dbus-adc/start-adc.sh: No such file or directory

chmod 755 /opt/victronenergy/dbus-adc/dbus-adc I get chmod: /opt/victronenergy/dbus-adc/start-adc.sh: No such file or directory

chmod 755 /opt/victronenergy/dbus-adc/service/run I get chmod: /opt/victronenergy/dbus-adc/start-adc.sh: No such file or directory

chmod 755 /opt/victronenergy/dbus-adc/log/runI get chmod: /opt/victronenergy/dbus-adc/start-adc.sh: No such file or directory

touch /var/log/dbus-adc I DID THIS

ln -s /opt/victronenergy/dbus-adc/service /service/dbus-adc I get -sh: chmod:: command not found


Since I couldn't get that working, I thought I would get the RTC to work, but couldn't get that either. I followed this:

###### RTC Clock for DS1307 ######

#install kernel module package.

opkg install kernel-module-rtc-ds1307 I DID THIS

#create /data/rc.local I DID THIS

#add this line to it to run on startup.

echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device I DID THIS

hwclock -s I DID THIS

#end lines


#for reference

#hwclock -w

#write the system time to rtc

When I try this, I get: hwclock: can't open '/dev/misc/rtc': No such file or directory

#hwclock -r

#reads it back from the rtc

When I try this, I get: hwclock: can't open '/dev/misc/rtc': No such file or directory

#hwclock -s writes rtc back to system time

When I try this, I get: hwclock: can't open '/dev/misc/rtc': No such file or directory


Any help would be appreciated.

Venus OSRaspberry Pi
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

5 Answers
buzzlightyear avatar image
buzzlightyear answered ·

Did you follow this part from https://docs.google.com/viewer?a=v&pid=forums&srcid=MDQyNDQ4NTczNDkwMjQ5NTM1OTkBMTQ1NTYyMTQ3NDM2NTIzNTUyNDYBLTRrVWU1cVZGZ0FKATAuMQEBdjI&authuser=0:


I downloaded the compiled image for the Venus GX, ripped out the /opt/victronenergy/dbus-adc directory from the image with 7-zip, copied the directory to the Raspberry Pi.

It sounds like you did not perform this step.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

nebulight avatar image nebulight commented ·

You are correct, I didn't do that. I did and now they are showing up. Thanks! Is there anything else that needs done, or do I just hook up the sender?

0 Likes 0 ·
Rob Duthie avatar image
Rob Duthie answered ·

Hi All

I have all the 8x analog ports going on the raspi 4 now OK this applies to the raspi3 as well.

It is using the mcp3208.dtbo overlay which has being converted for the raspi4

as the raspi3 uses mcp3208.dtb files.

I will post later here what is required not much is needed to make it all work.

Make sure config file has this added

dtparam=spi=on
dtoverlay=mcp3208:spi0-1-present

And add these files to the correct locations.
Attached correct mcp3208.dtbo file to the overlays folder.
Replace the dbus-adc.conf to the etc/venus folder
Replace the start-adc.sh in the /opt/victronenergy/dbus-adc folder.

Option to update this:
Now the venus.conf file is update of all the kernel drivers in candidate mode as victron keeps using the release version which has the old kernel drivers.
It still works OK with old driver but are out of date.

I could not upload so email your details to raduthie@gmail.com and i will send the files.


Regards

Rob D

NZ

13 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

johnwi avatar image johnwi commented ·

Hello Rob, I've downloaded the latest large version for the RPI2. I see in there also dtbo files instead of dtb files. Can this version run with the dtb file? because whatever I do, I don't get analog inputs working anymore (also not on older versions)

What I want is to have the latest possible release (large when possible) and get the analog inputs working based on the Raspberry Pi3+ with a Expander Pi board. Has someone succeded in that?

Which config's has to be eddited and files do I need?

0 Likes 0 ·
Show more comments
klausmortensen avatar image
klausmortensen answered ·

does a how to do for real dummies exist ? Iam trying to get this working but a struggling even with the basics of following the instructions !

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Rob Duthie avatar image Rob Duthie commented ·
Hi

Go to the raspi analog thread its all there how to do it.

0 Likes 0 ·
fgs-pantera avatar image
fgs-pantera answered ·

@nebulight Hi, im trying to follow your path and get venus os to recognize my MCP3008. You menitoned you where using an mcp3008-overlay.dtb file i cannot find anywhere online. Could you help me with that?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Rob Duthie avatar image
Rob Duthie answered ·

Hi

The file dtb has changed to .dtbo now , just rename it. as Victron has changed the Venus software.

Why dont you use a MCP3208 as it is 10 bit?

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

fgs-pantera avatar image fgs-pantera commented ·

Thanks @Rob Duthie !, I will just try that out. I will get the MCP3208 today and give it a try.

By the way, im downloading dbus-adc from:

https://github.com/victronenergy/dbus-adc

Is that correct? It seems to me that there could be an issue there!


Thanks :-)

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie fgs-pantera commented ·

And add these files to the correct locations.

Attached correct mcp3208.dtbo file to the overlays folder.

Replace the dbus-adc.conf to the etc/venus folder

Replace the start-adc.sh in the /opt/victronenergy/dbus-adc folder.

Contents file of the dbus-adc.conf below:

device iio:device0

vref 1.8

scale 4095


tank 0

tank 1

tank 2

tank 3

temp 4

temp 5

temp 6

temp 7

Regards

Rob D NZ

0 Likes 0 ·