Tariq’s Reef-Pi Journey

  • Thread starter Thread starter t951
  • Start date Start date
  • Tagged users None
Ok, I have narrowed this down a bit.
I changed the connector from the power supply to the 5v input on the pihat. When I wiggle, both the old cable and the new one I can get some red lights to flicker on the pi-hat. Right now the raspberry is powered up and working, but there is nothing happening on the pi-hat. Is it possible that the pi-hat pins that are soldered into the board have an issue?
I have also checked and the voltage is good on the solder spots on the bottom of the pi-hat board as well as when I check them from the top, touching the wires.
Any ideas?
 
Is there a way from raspbian to see if the pi-hat is connected and I can check for errors?
Should I see lights on the board? (the pi-hat).
I have seen brief flickers but nothing stays on. i have good voltage at the pins on the side and the 5v power input as well.
I am sorry for being sooooo needy! Believe me, I feel bad with the barrage of constant questions.
Hopefully, I can turn this learning experience into a document for someone else.

t.
 
I'm not sure I fully understand the behavior you are experiencing, but I'll do my best to help.

The circled components below are responsible for allowing 5v from the 5v port to flow into the hat and into the rpi. If you don't have too much hooked up, can you see if there is any visual abnormality in that section?
1591917284324.png


If it looks good, an easy spot to check for 5v is on the 10 pin output.
1591917623727.png


The hat does not need to be powered from that 5v port; it can user power from the rpi directly.

I think it would be extremely unlikely for any of the soldered through pins to have any issue, but I suppose it could be possible.

Since the rpi is powered, the first thing I would check would be to ensure that the PCA9685 is recognized. What do you get when you run the following from the command line on the pi with the hat connected?

Code:
sudo i2cdetect -y 1

This is a version of the test script I use. You can load it onto your pi and execute it to confirm that the individual components are working by observing the progression of the indicator LEDs. You'll need i2ctools and and libgpiod installed. .
 
Michael, as always, thank you for the fast and detailed reply.
When I run your command I get:

sudo i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory

I looked under a lit magnifying glass and it looks prisitine.

I tried a different pi-zero, same result.

I tried a Pi3B+ and I get the two faint lights.


On the second picture I get 5v at all those points


Thank you again.

pi lights r.jpg ML-pihat voltage r.jpg
 
OK. All of that sounds like good information. The 2 dim lights makes sense on the 3B due the default GPIO states, and is consistent with a working hat.

It sounds like Raspbian may not be configured yet. Can you try to enable i2c and run that command again?

 
Well, I have made good progress, but only on the pi3.... I guess that's what I will run.

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: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

Thank you again!
t.
 
Ok, so I ran your test script and I see all the LED's light up in order....but I keep getting this message:

fading 22
fading 26
setting PB1
./ml.sh: line 53: gpioset: command not found
setting PB2
./ml.sh: line 55: gpioset: command not found
setting PB3
./ml.sh: line 57: gpioset: command not found
setting PB4
./ml.sh: line 59: gpioset: command not found
setting PB5
./ml.sh: line 61: gpioset: command not found
setting PB6
./ml.sh: line 63: gpioset: command not found
setting PB7
./ml.sh: line 65: gpioset: command not found
setting PB8
./ml.sh: line 67: gpioset: command not found
setting PA1
./ml.sh: line 70: gpioset: command not found
setting PA2
./ml.sh: line 72: gpioset: command not found
setting PA3
./ml.sh: line 74: gpioset: command not found
setting PA4
./ml.sh: line 76: gpioset: command not found
setting PA5
./ml.sh: line 78: gpioset: command not found
setting PA6
./ml.sh: line 80: gpioset: command not found
setting PA7
./ml.sh: line 82: gpioset: command not found
setting PA8
./ml.sh: line 84: gpioset: command not found


I have run sudo raspi-config and enabled 1-wire and I2C.

Is this because you have your ports labelled PA5, etc?

The only thing I labelled were the DJ SC8 ports. (Hopefully correctly). I used your image of the board with all the ports labelled (IO22, 23, 24) and created the outlets.

I have tried google-fu'ing to see if there is a gpio command that I need to enable for the script to work. I used the gpio -v to verify it us running, it is v 2.5

and gpio i2cdetect and cgot the same result as the command you gave me.

Thanks again,

t

rpi_int_list.PNG outlets.PNG 1567358264013.png
 
That's a positive result. The outlet set up looks correct to me.

I think gpio command is from wiringpi. It looks like you do not have libgpiod installed, which is what that script uses for regular gpio. You don't need it for reef-pi, but you should be able to install it using
Code:
sudo apt-get install gpiod
 
Here is where I am stuck.
I have the pihat on 3B and it appears to work well.
I CANNOT add the HS300. It let me add an HS100, but then it just kept giving me the same errors. I then decided that all of my troubleshooting and tinkering could be an issue so I went full nuke.

Formatted card
Freshly installed Raspian and reef-pi
All IPs are static (power supply, reef-pi (assigned DHCP but static)

Same bloody error.

I did get the inability to add local devices for a bit.

6/16/2020, 5:08:56 PMUIERROR{"error":"Failed to create. Error: remote I/O error"} | HTTP 500
but that seems to have magically resolved itself.
I see this
pi@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: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

I added the PWM for address 64 and the PiHat at 69

I don't know what the 70 is.

I tried the setting where the network needs to be up before reef-pi starts.....nada

I am so frustrated. I have googled all kinds of stuff (looking at Go driver issues, generic raspian connection issues, etc). Everyone seems to just set the HS300 and be happy.....

Is there anything else that I can try?

Thank you guys again, I truly do appreciate the extra effort you guys show.
 
Here is where I am stuck.
I have the pihat on 3B and it appears to work well.
I CANNOT add the HS300. It let me add an HS100, but then it just kept giving me the same errors. I then decided that all of my troubleshooting and tinkering could be an issue so I went full nuke.

Formatted card
Freshly installed Raspian and reef-pi
All IPs are static (power supply, reef-pi (assigned DHCP but static)

Same bloody error.

I did get the inability to add local devices for a bit.

6/16/2020, 5:08:56 PMUIERROR{"error":"Failed to create. Error: remote I/O error"} | HTTP 500
but that seems to have magically resolved itself.
I see this
pi@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: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

I added the PWM for address 64 and the PiHat at 69

I don't know what the 70 is.

I tried the setting where the network needs to be up before reef-pi starts.....nada

I am so frustrated. I have googled all kinds of stuff (looking at Go driver issues, generic raspian connection issues, etc). Everyone seems to just set the HS300 and be happy.....

Is there anything else that I can try?

Thank you guys again, I truly do appreciate the extra effort you guys show.
70 is the all call address of pca9685. it is used to control all channel at once. reef-pi driver does not use it.

So none of the drivers are working? including Kasa as well as pwm? The error you have shared shows i2c related issue and not hs300 related issues.
At this point I can only recommend isolate systematically diagnose one problem at a time. You are new to this, and tackling multiple problems together will make it hard to get to the bottom of any of this.
Let's first sort out the hs300 issue. From your previous post I recollect that it works when you add it and not when you reboot it. If that's not the case let me know.
It is a known issue that if you use the kasa smartplug , then upon reboot the driver loading fails due to reef-pi starting before network is up. You can edit the systems unit file, its located at: /lib/systemd/system/reef-pi.service

Code:
[Unit]
Description=raspberry pi based reef tank controller
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/usr/bin/reef-pi daemon -config /etc/reef-pi/config.yml
WorkingDirectory=/var/lib/reef-pi
Restart=always
RestartSec=90
StartLimitInterval=400
StartLimitBurst=10

[Install]
WantedBy=multi-user.target

Note the " Wants=network-online.target After=network-online.target" directives. They tell systemd to not start reef-pi till network is up. After the changes, if you reboot, hs300 driver should still work.
Let me know if you are testing this out, i.e. hs300 driver creation work, reboot without the unit file changes fails the driver load, and if you update the systemd unit file and reboot then the hs300 driver works.
If this works, we can proceed with the pca9685 driver debugging
 
Ranjib,
Thanks for the post.
I tried the suggestion you mention already. No change.
The HS300 driver is never able to be added.
I have added the pwm, and the pihat fine.
Reboot. or reload has never allowed me to load the hs300.
The most bizarre behavior is that I can now ping the hs300 from my laptop which is on the same access point, but not from raspberry, also on the same access point. my desktop, which is wired cannot ping it either.
broadcast/multicast are enabled for all
 
Ranjib,
Thanks for the post.
I tried the suggestion you mention already. No change.
The HS300 driver is never able to be added.
I have added the pwm, and the pihat fine.
Reboot. or reload has never allowed me to load the hs300.
The most bizarre behavior is that I can now ping the hs300 from my laptop which is on the same access point, but not from raspberry, also on the same access point. my desktop, which is wired cannot ping it either.
broadcast/multicast are enabled for all
Well, this means at least the kasa smartplug issue is from network. I can confirm that I can ping all my kasa products (hs103,hs110,hs300, just tried now). What wifi router you are using?
 
Ubiquiti USG Router
Ubiquiti Unifi AC Pro AP
RF Scan shows channel 1 best, set at HT20.
Signal strength excellent.
Broadcast/multicast enabled.
As I said, I can ping the HS300 from only one device. All other devices show destination host unreachable.
The raspberry can ping everything fine, (local and external) and can resolve the name via dns to ip, but no ping.
My plan for this morning is to try putting the hs300 on an older cisco wap.
test.
Next I may try and connect the raspberry on cabled ethernet
test
I will try variations of wifi/cabled and see what I find.

As I said in the other thread, the error is failed to dial. Does that mean it is not even able to try and connect?

Thank you again,

ps Do you ever sleep?!?!

When my system is running I will be posting a lessons learned document.

And finally, when this is over, if there is a way I can thank you, please let me know.

Thanks again,
t
 
OMG, I got it to work. And it is lovely when it is working!

I placed the raspberry and the HS300 on the old cisco wap. At this point all windows and linux devices could ping the HS300, but not the raspberry.

I disabled the wireless on the raspberry and used the ethernet connection, and WALA.....everything works!

The issue is the wireless on the raspberry pi. I don't know if it is a driver (wifi card) issue, or there is some sort of built in firewall setting on the wifi for the raspberry. Either way, I will run a ethernet cord to the rpi and use the wireless plugs on the HS300.
 
ML,
Do you have a document that contains all of your configuration steps? I am slowly making progress and I would prefer to use a proper solution.
I am setting up my ATO. The Ranjib guide on adafruit mentioned a 12v pump. How does the pi-hat control the ATO pump?
I have the ATO sensor connected as you mentioned here previously. (ATO1, pin IO27).
I imagine I could use the ATO2 for a switch to a float valve.
How does the pump get wired? I have the 12v power going into the board via the connector on the hat.
Do I connect a cable to V+ and pick an IO, IO8 for example?
Thanks again,
t.
 
ML,
Do you have a document that contains all of your configuration steps? I am slowly making progress and I would prefer to use a proper solution.
I am setting up my ATO. The Ranjib guide on adafruit mentioned a 12v pump. How does the pi-hat control the ATO pump?
I have the ATO sensor connected as you mentioned here previously. (ATO1, pin IO27).
I imagine I could use the ATO2 for a switch to a float valve.
How does the pump get wired? I have the 12v power going into the board via the connector on the hat.
Do I connect a cable to V+ and pick an IO, IO8 for example?
Thanks again,
t.
Like a snowflake, each reef-pi can be unique. reef-pi has also gone through some significant changes over the last year, so it can be tough to keep everything current.

What are you planning to use for a pump? I'm using a regular 120v pump wired as an equipment for ATO.
 
Like a snowflake, each reef-pi can be unique. reef-pi has also gone through some significant changes over the last year, so it can be tough to keep everything current.

What are you planning to use for a pump? I'm using a regular 120v pump wired as an equipment for ATO.
ML,
Thanks for the reply.
I actually have a 12v pump that I bought based on Ranjibs guide, but I also have a small one that is 120VAC.

My questions about the documentation were about very generalized info. For example, connect ph to this connector (I think the gobi hat has it labeled, mine is I2C).

I am almost done with the hardware connectivity, but before I button down the components I have another question.

I have setup Reef-Pi to use pins 4,5,6. These pins will activate the three doser pumps. I imagine that each motor gets the positive connected to a pin. (Motor 1 goes to pin 4, Motor 2 to 5, etc). I read the thread and know that they should share the ground with the controller to avoid voltage drift. My question is how do I get 12v to those pins.
I have a buck converter that connects to the hat 12v.
Each motor has a + -
So the wiring from the motors would go from my second box (holding the dosers), to my reef-pi box. A straight through connection with 3 wires for positive (one for each motor) and a shared ground. The wires then get connected to what?

I hope my question is clear....

TLDR....how do i power 12v pumps from the pi-hat?

Thank you again!

t.
 
ML,
Do you have a guide for wiring the pi-hat to the ATO pumps? Also, if it makes my life easier, I would like to just order your jabeo module....when are you going to have more?

Thank you again,
t.
 
ML,
Do you have a guide for wiring the pi-hat to the ATO pumps? Also, if it makes my life easier, I would like to just order your jabeo module....when are you going to have more?

Thank you again,
t.
I've also used an aqua lifter, but I've replaced it with a regular water pump for my ATO. In my case, it's just set up as an equipment and connected to an outlet. You can also do the same thing with a 12v pump using a regular AC adapter.

Otherwise, I'd recommend using a ULN2803, a mosfet, or a relay to run the 12v pump.

I have parts on hand to build a few more dosing pump adapters. I just picked up a new contract at work, so I've been super busy getting ramped up on everything, but I'll make a few Jebao adapters available tonight.
 

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top