Using more than 5 GrovePi's with the multi_installer

Hi there

I’m trying to use 8 GrovePi’s together. Currently, I’m able to get 5 of them running using the multi_installer and the instructions provided here.
Unfortunately, the script is only able to work with the addresses 3 to 7, and the Python and cpp.hex files are only for those addresses.
What can I do to make more addresses work? I was able to expand the script and add Python files with additional addresses, but the cpp.hex files give me a headache. Any idea how to make it work?

In the end, I would like to have 8 GrovePi’s with different addresses (for example 1 - 8).
Many Thanks!

1 Like

@tobias.kunz

First, welcome in!

Second:

  1. I’ve never done this before and I don’t have access to that install script right this second, so I’m winging it.
  2. It appears that you cannot use i2c addresses below “3” as they appear to be reserved.
  3. Depending on what’s going on in that script, you may be able to modify it to give you the addresses you need.

If you can post the script and CPP header files as an attachment to the post, I’ll try to take a look at them and give you what advice I can.

1 Like

Cheers jimrh, thanks for the reply!

The multi_installer.sh script can be found here.
The relevant part for me is this line, which in this case uses address 3:

sudo avrdude -c gpio -p m328p -U flash:w:grove_pi_v1_2_2_addr3.cpp.hex

Here the file grove_pi_v1_2_2_addr3.cpp.hex is used. The exact file can be found on the same github page linked above. So far I was unable to actually understand the file, since I don’t know how to de-hex it.
But I was able to find this:
Using the GNU “diff” tool I learned that the only difference between two of those cpp.hex files is one line, for example:

diff grove_pi_v1_2_2_addr3.cpp.hex grove_pi_v1_2_2_addr4.cpp.hex
addr3 :100F200084EB92E00E944A1663E070E087EE91E065
addr4 :100F200084EB92E00E944A1664E070E087EE91E064

(Output slightly adjusted for readability, the relevant parts have been marked with bold font)

Some googling led me to this site, where I learnt that the format presumably is:

[:][Byte Count][Address][Record Type][Data][Checksum]

So for the strings above this gives me:

addr3 [:] [10] [0F20] [00] [84EB 92E0 0E94 4A16 63E0 70E0 87EE 91E0] [65]
addr4 [:] [10] [0F20] [00] [84EB 92E0 0E94 4A16 64E0 70E0 87EE 91E0] [64]

The same is true for all the other cpp.hex files - when the address goes up, that one digit on the left goes up and the last digit in the checksum is reduced by one. From this I conclude that I could just copy the file, adjust this one line and the script and it should work.
For address 8 and 9 for example, the lines would be:

addr8 [:] [10] [0F20] [00] [84EB 92E0 0E94 4A16 68E0 70E0 87EE 91E0] [60]
addr8 [:] [10] [0F20] [00] [84EB 92E0 0E94 4A16 69E0 70E0 87EE 91E0] [5F]

(obviously without the additional formatting)

Now I haven’t tested it yet, I am kinda afraid after all that this is horribly stupid.
Any thoughts?

2 Likes

Quick update. I was able to make it work with the procedure above :blush:
Thanks a lot for the help.

Cheers!

3 Likes

In this context there is no such thing as “stupid”. Some ideas work, others don’t.

Glad to hear you got it working!

hey @tobias.kunz
Nice work!
Would you like to push it to the official repo so more people can run 8 grovepis too?

1 Like

Good idea. I’ve opened a pull request on the repo with my changes.

Cheers.

2 Likes