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 ·
Rob Duthie avatar image Rob Duthie johnwi commented ·

Hi

The only change to do is add this file to the etc/venus folder.

And change the overlay .dtb to .dtbo for raspi 3 and rapsi 4 units. Also do you have the modifed overlay mcp3208.dtbo ?

as this is 10-12bit, also the old mcp3208-overlay.dtb has being renamed to mcp3208.dtb now to work correctly.


dbus-adc.conf.txt

Regards

Rob D

NZ

0 Likes 0 ·
johnwi avatar image johnwi johnwi commented ·
After 3 days I've reached my goal. Venus large 2.92 with expander pi and analog inputs, also running package manager.
0 Likes 0 ·
kon10 avatar image kon10 johnwi commented ·

Hi. do you have any information on how to make this possible? i am running the same firmware but cant make the analog inputs work.

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie kon10 commented ·
Hi Have you followed the advise above?

What have you setup etc?

0 Likes 0 ·
kon10 avatar image kon10 Rob Duthie commented ·
i dont think i have the right files. i am trying this with a rpi3 with the latest firmware. I use a mcp3208 on a breadboard with vref at 1.8v and the required resistors. I do not have the menu for analog input. i have added the right information in the adc config file too and added the lines in the uboot config file also. Where can i find the right mcp3208 file?
0 Likes 0 ·
Rob Duthie avatar image Rob Duthie kon10 commented ·
Do you have analog under settings for I/O?Email me direct i will send you the file.


0 Likes 0 ·
kon10 avatar image kon10 Rob Duthie commented ·

no i have not. only digital inputs and the bluetooth option. I email you.

0 Likes 0 ·
scaldiss avatar image scaldiss Rob Duthie commented ·

Hello,

I have the same problem.

I have an rpi 3 B and version 2.92 and have installed adc properly installed but also get no analog settings in the IO menu. I don't see anything in the device list either.

I also installed adc in version 2.60 and it works there. And now I've done the same.

I hope you can help me further. Regards Ed

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 ·