uugear / Witty-Pi-4

Software and Firmware for Witty Pi 4
MIT License
23 stars 16 forks source link

Seems Witty Pi board is not connected? #8

Closed asztalosdani closed 5 months ago

asztalosdani commented 1 year ago

Hi,

I have a Witty Pi 4 L3V7 connected to a Raspberry pi zero W, the power is connected to the Witty, I can turn the raspberry on/off using the button. I installed the witty software following the documentation, but running ./wittyPi.sh results in

================================================================================
|                                                                              |
|   Witty Pi - Realtime Clock + Power Management for Raspberry Pi              |
|                                                                              |
|            < Version 4.13 >     by Dun Cat B.V. (UUGear)                     |
|                                                                              |
================================================================================

Seems Witty Pi board is not connected? Quitting...

And indeed running i2cdetect -y 1 outputs

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

I confirmed i2c and serial port is enabled in raspi-config. What else should I try?

uugear commented 1 year ago

Most probably it is due to unreliable connection. This is more likely the case when using it with Raspberry Pi Zero W -- please double check the header soldered on Raspberry Pi Zero W (especially for SDA and SCL pins).  It has to be well soldered, and just putting the header in place will not be enough.

asztalosdani commented 1 year ago

The header is well soldered, it should not be a problem. Above I was trying it with v4.13 on 64 bit Raspbian 11 (bullseye), then I found an other sd card, with 32 bit Raspbian 10 (buster) and witty pi v4.10 installed on it. Running it here results in Error: Read failed printed over and over.

Is every os version compatible? How can I revert to an older version of Witty pi? What else can I try?

uugear commented 1 year ago

Older version of software might wrongly detect the board and hence try to communicate with it and prints out the Read failed errors. To you the results are the same with both SD cards: the board is not detected.

However it doesn't seem to be the firmware issue too. As you can turn on your Pi by tapping the button on Witty Pi 4, it means its firmware is functioning well. It is the same firmware that emulate an I2C device with address 0x08, which should also be detected.

Can not rule out the possibility that your Raspberry Pi's I2C bus is faulty (we have saw several cases like that). It is recommended to try it with another Raspberry Pi to narrow down the issue.

asztalosdani commented 1 year ago

I tried with another raspberry, with both sd cards, with same results. However! I tried it with another Witty pi board, and it worked. I can see the data, and interact with the wittypi.sh script. So could it be firmware issue on the first one? Should I try to update it?

uugear commented 1 year ago

You may give it a try but the information we have do not point to that direction: the firmware seems working already.

asztalosdani commented 1 year ago

What else should I try? Is it a defective board?

uugear commented 1 year ago

It doesn't seem to be a defective board. The firmware is working and the board can boot your Raspberry Pi. Every board passed the tests that involved I2C communications.

Is the another Witty Pi board you tried also a Witty Pi 4 L3V7?

Can you use multimeter to confirm the SDA and SCL wires were well connected between your Witty Pi 4 L3V7 and Raspberry Pi?

tomjn commented 1 year ago

Noting I'm in this exact situation with a Witty Pi 4 mini + Pi Zero 1 W. I've used a hammerhead GPIO pin header from pimoroni + extender pins to connect it and receive the same output from the debug commands. The board still powers the Pi though.

Something to note though, while I'm going to experiment with other headers to try and improve the pin connection, it might be nice if the software said this so I didn't have to google and read through github, especially since the message is a rhetorical question

This:

Seems Witty Pi board is not connected? Quitting...

Would be better with something like this:

We cannot detect a connected Witty Pi board, please attach a board and double check the header connection is secure if one is already attached. Quitting...

Bonus points if it can directly link to a debugging/troubleshooting doc

tomjn commented 1 year ago

PR created to do just that: https://github.com/uugear/Witty-Pi-4/pull/13

I couldn't find a suitable doc to link to, but I did fix some tab/space mix issues and mentioned the version of the board the script is intended for in the output since I noticed a lot of the tech support threads ask this and it'd be unnecessary if the script just stated it