turing pi 1 - master node OFF
# │forum
v
i shutdown master node on TP 1 with command sudo i2cset -m 0x02 -y 1 0x57 0xf2 0x00 Im not expirienced in I2C and i got RPI4 on side. Need some help with wireing RPi4 to TP 1 and commands. All help is most welcome
t
What all are you trying to accomplish?
Are you trying to control the TP1 via I2C using your RPi4?
v
Im trying to power ON Master node on TP1
t
how many nodes do you have on the TP1?
Copy code
WARNING:The register which controls the power to each board is backed by an EEPROM. Don't set all bits in there to 0, otherwise you won't be able to boot and correct it. A fix is to set register 0xF4 to 1 which would send the writes to the shadow SRAM, instead of the EEPROM. A fix for this is to connect an external raspberry pi to the I2C External pins and reset the registers
I think the last option is what you were thinking about?

https://www.youtube.com/watch?v=V9A7omAC1a4

apologies for dumping all this info here
@vladvanderwolf if you have other nodes, you can configure their I2C and power on the first node manually from there
v
We are trying to power on Master node and tried all steps from above. - we are newbies in this filed and we need help with command
0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- 57 -- -- -- -- 5c -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU 70: -- -- -- -- -- -- -- -- root@raspberrypi:/home/admin# sudo i2cget -y 1 0x57 0xf4 0xff root@raspberrypi:/home/admin# sudo i2cget -y 1 0x57 0x00 0x00 root@raspberrypi:/home/admin# sudo i2cset -y 1 0x57 0x00 0x77 root@raspberrypi:/home/admin# sudo i2cget -y 1 0x57 0x00 0x77 root@raspberrypi:/home/admin#
what we did so far 🙂
ChatGPT says "i2cset -y 1 0x57 0xf41"
🙂
t
if you type in
sudo i2cdetect -y 1
on your Raspberry Pi 400, what does it output?
what do you get if you type
sudo i2cdetect -y 0
?
to be honest I haven't messed with I2C much, but I needed to play with some settings for a device connected to node 1's GPIO pins to show up
you might need to adjust with some
dtoverlay
settings inside
/boot/config.txt
on your Raspberry Pi 400
t
I set my I2C on Bus 4. So my instruction to power on/off my nodes are:
i2cset -m 0x40 -y 4 0x57 0xf2 0xff where 0x40 is the node I am trying to on/off which is 6
If I want to turn off my master node which is node 1 would be: i2cset -m 0x02 -y 4 0x57 0xf2 0x00
If I want to turn on my master node which is node 1 would be: i2cset -m 0x02 -y 4 0x57 0xf2 0xff
So nodes go like: 0x02 - 1 0x04 - 2 0x08 - 3 0x10 - 4 0x80 - 5 0x40 - 6
0x20 - 7
I have my Pi4 wired to my turing p1 on the 23,24 pins
v
admin@raspberrypi:~ $ dmesg | grep i2c [ 3.558478] i2c_dev: i2c /dev entries driver [ 5.225198] brcmstb-i2c fef04500.i2c: @97500hz registered in polling mode [ 5.254784] brcmstb-i2c fef09500.i2c: @97500hz registered in polling mode admin@raspberrypi:~ $ ls /dev/*i2c* /dev/i2c-1 /dev/i2c-20 /dev/i2c-21 admin@raspberrypi:~ $ dmesg | grep rtc [ 7.238923] rtc-ds1307 1-006f: registered as rtc0 [ 7.241469] rtc-ds1307 1-006f: setting system clock to 2023-04-08T19:32:00 UTC (1680982320) admin@raspberrypi:~ $ ls /dev/*rtc* /dev/rtc /dev/rtc0 admin@raspberrypi:~ $ sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- 57 -- -- -- -- 5c -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU 70: -- -- -- -- -- -- -- --
admin@raspberrypi:~ $ sudo i2cget -y 1 0x57 0xf2 0xff admin@raspberrypi:~ $ sudo i2cget -y 1 0x57 0xf3 0x01 admin@raspberrypi:~ $ sudo i2cget -y 1 0x57 0xf4 0xff my TP1 admin@raspberrypi:~ $ sudo i2cget -y 1 0x57 0xf8 0xff TP documentation Compute Module status sudo i2cget -y 1 0x57 0xf8 0x0e # register 0xf2 = 0xff, all slots are power up but installed only three
tied @themaudalorian commands but nothing is changed, red LED is on for all nodes
admin@raspberrypi:~ $ i2cset -m 0x02 -y 1 0x57 0xf2 0xff admin@raspberrypi:~ $ i2cset -m 0x04 -y 1 0x57 0xf2 0xff admin@raspberrypi:~ $ i2cset -m 0x08 -y 1 0x57 0xf2 0xff admin@raspberrypi:~ $ i2cset -m 0x10 -y 1 0x57 0xf2 0xff admin@raspberrypi:~ $ i2cset -m 0x80 -y 1 0x57 0xf2 0xff admin@raspberrypi:~ $ i2cset -m 0x40 -y 1 0x57 0xf2 0xff admin@raspberrypi:~ $ i2cset -m 0x20 -y 1 0x57 0xf2 0xff
there is a "WARNING:The register which controls the power to each board is backed by an EEPROM. Don't set all bits in there to 0, otherwise you won't be able to boot and correct it. A fix is to set register 0xF4 to 1 which would send the writes to the shadow SRAM, instead of the EEPROM. A fix for this is to connect an external raspberry pi to the I2C External pins and reset the registers"
and when i do i2cget -y 1 0x57 0xf4 result is 0xff
per documentation of i2C chip, default value for f4f is 00h
Question - what is command to change value 0 to 1 on 0xf4
i2cset -y 1 0x57 0xf4 "xxx"
thanks in advance 🙂
t
What do you have in: sudo nano /boot/config.txt
v
model: RPi 400
admin@raspberrypi:~ $ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian admin@raspberrypi:~ $ uname -m aarch64
root@raspberrypi:/home/admin# i2cdetect -l i2c-20 i2c fef04500.i2c I2C adapter i2c-1 i2c bcm2835 (i2c@7e804000) I2C adapter i2c-21 i2c fef09500.i2c I2C adapter
t
I’m looking more into this; I’m thinking about experimenting with
I2C
myself
v
if I ever power this thing ON, I'm not experimenting any more 😀
t
I might need to wire my TP1 to an external Pi so it's setup like your system to test
I only have 2 out of the 7 slots filled (with CM3+), so I'll enable the shadow SRAM feature and just test with node 2
I've ordered some gear from Amazon to try to match your configuration and test it myself
t
This is how I set it up. I have my I2c set to bus 4 and cabled the turing pi to the pins 23 and 24, don't forget to wire the gnd and +3v [ALL] dtparam=audio=on dtparam=i2c_arm=on dtparam=spi=on dtoverlay=i2c-gpio,bus=4,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24
sudo nano /boot/firmware/config.txt
So plug the gpio 23 to the sda pin on the turingPI and the GPIO 24 to the SCL pin on the TuringPi. Also, connect the ground and the 3+v cables
that should do it.
you need to reference your instructions to use bus 4
# Power on worker nodes sudo i2cset -m 0x02 (Node number) -y 4 (bus number) 0x57 0xf2 0xff (ON) # Power off node #1 sudo i2cset -m 0x02 (Node number) -y 4 (bus number) 0x57 0xf2 0x00 (OFF)
# 0x02 : Node #1 (worker 1) # 0x04 : Node #2 (Worker 2) # 0x08 : Node #3 (Worker 3) # 0x10 : Node #4 (Worker 4) # 0x80 : Node #5 (Worker 5) # 0x40 : Node #6 (Worker 6) # 0x20 : Node #7 (Worker 7)
run sudo i2cdetect -l and you should see: i2c-1 i2c bcm2835 (i2c@7e804000) I2C adapter i2c-4 i2c 400000002.i2c I2C adapter
Check what you are getting from your bus 4: sudo i2cdetect -y 4
sudo i2cdetect -y 4 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- 57 -- -- -- -- 5c -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 6f 70: -- -- -- -- -- -- -- --
v
admin@raspberrypi:~ $ sudo i2cdetect -l i2c-20 i2c fef04500.i2c I2C adapter i2c-1 i2c bcm2835 (i2c@7e804000) I2C adapter i2c-4 i2c 400000002.i2c I2C adapter i2c-21 i2c fef09500.i2c I2C adapter
it scanning I2C now, but its doing it wery slow
rtc not working
admin@raspberrypi:~ $ ls /dev/rtc ls: cannot access '/dev/rtc': No such file or directory
but I2C is detected
admin@raspberrypi:~ $ dmesg | grep i2c [ 3.351733] i2c_dev: i2c /dev entries driver [ 4.750000] i2c-gpio 400000002.i2c: using lines 23 (SDA) and 24 (SCL) [ 5.218472] brcmstb-i2c fef04500.i2c: @97500hz registered in polling mode [ 5.227668] brcmstb-i2c fef09500.i2c: @97500hz registered in polling mode
t
I got the same
now try to switch on your node
v
i think rtc not working now, "sudo i2cdetect -y 4" is working realy slow
t
that might be because of the cables
I had that issue
make sure they are connected correctly
v
let me get new cable
t
the ones from the GPIO to the TuringPI sda,scl,gnd and pwr.
make sure they are wired to the right GPIO's
remember to power off the raspberryPI and the turingPI board while doing it.
v
thanks, will try tommorow... its almost midnight here
t
perfect. let us know !!
t
@themaudalorian I’m not sure but I think @vladvanderwolf might have the Turing Pi’s I2C wired to a different bus in the past, but if they followed your instructions, it should be right now.
I’m considering wiring the I2C of my Turing Pi 1 to a spare Raspberry Pi Zero (or perhaps an original 256MB Pi B)
t
Those are the ones I used
I did it on a Pi4 because of Master node requirements. I was having a lot of issues with the Master node on a Pi3+ module due Memory.
on the TuringPi
No the issues I have is that sometimes my turingpi modules get corrupted and I have to turn them off on thru the Ic2 bus. And in some occasions I have to re-image them
t
I was just thinking of using a low-power Pi to act as a BMC of sorts… also, I have some Pi’s just sittting around
t
Time to un-dust them 😛
t
I was also considering setting up a NetBoot system with my CM3+’s
t
Sounds interesting
I also wanted to adventure into the "serverless" world with those CM3+'s
I don’t think CM3’s can fully NetBoot on their own, but you might be able to install a thin bootstrap, to load the images off a TFTP, HTTP, or NFS system (I’ve never used NetBoot before)
t
Me neither. But there is always a first time
t
I'm acquiring some tools to use my old Raspberry Pi (256MB) as a BMC for the TP1
d
This sounds fun. What's your idea?
t
(My TP1 is in a 1U case with a tiny ATX PSU)
d
I know nearly not enough about TPi1 to have any guess on how that is going to work together 😄
I learned that I2C is your friend here, but that's all 😄
t
the pinout for the I2C header is almost the same as the one on the SparkFun adapter
the Turing Pi 1's external I2C port pinout is as follows:
Copy code
|  1  |  2  |  3  |  4  |
| GND | VCC | SCL | SDA |
SparkFun's qwwiic and Adafruit's STEMMA Qt use the same pinouts:
Copy code
1. GND (black)
2. VCC (red)
3. SDA (blue)
4. SCL (yellow)
so, between the two, pins 3 and 4 are reversed
I'll just swap these two wires in the jumper wires between the SparkFun Qwwic Shim and the header on the TP1
at the very least, I should be able to power nodes on/off, and control the ATX power supply
just mixed two together for an IO shield:
no clue if it's aligned or not...
just realized I'm taking over this thread... I started this as a means to assist with the I2C TP1 node solution... I'll move this to my blog
@vladvanderwolf any update?
I have my Pi B tied into the I2C on the TP1. I can successfully power individual nodes on and off.
Copy code
dietpi@T1-BMC:~$ sudo i2cset -y -m 0x04  1 0x57 0xf2 0x00
dietpi@T1-BMC:~$ sudo i2cset -y -m 0x04  1 0x57 0xf2 0xff
^ on the Pi B
node 2 off... and then on
t
Nice !!!!
t
will be "prettied" up soon
after getting the RTC driver working:
Copy code
dietpi@T1-BMC:~$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- 57 -- -- 5a -- 5c -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU 
70: -- -- -- -- -- -- -- --
57
is the Turing Pi 1's I2C expander;
5c
is the Turing Pi 1's RTL8370 Ethernet switch
6f
is the Turing Pi 1's RTC chip, unavailable because it's driver is loaded
got a little more work done, designed some mounting brackets and sent off to have them 3D printed...
t
That looks so cool
t
I just hope the parts fit when I receive them; I should have them in a few days Monday!
Parts arrived! Designs were off a bit - my fault - with a drill I made them fit. I might correct them and send the designs out again.
made some updates
due to the length of the USB and HDMI extension cables (interior ones), I need to swap the USB and HDMI locations on the I/O shield
the Ethernet location on the I/O shield was perfectly aligned 🙂
but it either needs 100% infill (only did 60%) or I should have it laser-cut out of acrylic or metal
it's way too thin and flexible
d
Does it even have some infill? Looks thin-enough to have just top/bottom layers
t
it's only a few mm thick
2 mm or 3 mm
there's tabs on the bottom to snap into the case... if it was too thick they wouldn't fit
if I just ignored the tabs I could have made it a little thicker... the top isn't even screwed in (this case uses the tabs and two screws on the sides of the top to keep the I/O shield in place)
Copy code
admin@raspberrypi:~ $ ls /dev/i2c
/dev/i2c-1  /dev/i2c-20  /dev/i2c-21
@vladvanderwolf so you have 3 I2C busses? (1, 20, and 21)
there should only be two at most; the main one (1) and the one that accesses the HAT EEPROM (0 iirc)
m
Currently I got to play around with@vladvanderwolf 's TP1 for testing to see if I can resolve the issue. Strange enough the problem does not seem to be present. Clean install of Rpi OS 64 bit Lite on all nodes, enabled i2c with correct dtoverlay. After delibirately turning off all slave nodes from Master issueing
sudo i2cset -m 0xfc -y 1 0x57 0xf2 0x00
and
sudo i2cset -m 0x02 -y 1 0x57 0xf2 0x00
to also turn off the master, I can use my Rpi4 connected to i2c to confirm all the nodes are down:
sudo i2cget -y 1 0x57 0xf2
return:
0x01
. After that I can use the Rpi4 to start everything again issueing the command
sudo i2cset -m 0xfe -y 1 0x57 0xf2 0xff
after which all the nodes turn on. What I do find to be strange is that when you only connect SDA, SDL and Gnd, i2c does not work between TP1 and RPi4. After connecting 3.3v as well the i2c started working. Is that expected behavior?
well, after trying
sudo i2cset -m 0xfc -y 1 0x57 0xf2 0x00
the system was in deadlock again. Unable to power up anything over i2c. although i2cget showed that the values changed, the modules did not power on. Now i removed the power cord from the AC Power brick to the TP1, left the RPi4 on i2c and waited for the power led of the Power Brick to die out. Then I removed the i2C cables and plugged the AC cable back into the power brick. NOW it really starts.... Damn what a p.i.t.a. system if you treat it wrongfully.
t
I had to have
SDA
,
SCL
,
GND
, and
3.3v
all connected for I2C to work correctly
v
thank you James Bond from Arrakis. As we said - expensive rookie mistake 🙂 .... but stake was realy good
13 Views