-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not detect Raspberry Pi 3B+ on linux 4.19 64-bit #316
Comments
Please describe in more detail how you initiate pigpiod and the 'hang condition' associated with pigs. |
I built and ran pigpiod as compiled from sources within buildroot using gcc 9. Their package definition is here: https://github.com/buildroot/buildroot/tree/master/package/pigpio I'm running on a Raspberry Pi 3B+ I launched it as a process with the following command line: When I tried to query the state of one of the output pins using 'pigs r 17', the pigs program just hung. No response, used CTRL-C to exit. Using strace, I could see that the socket got connected, but the other side didn't accept it. I then used gdb and strace to debug the pigpiod service and saw it was in a quick query loop somewhere in the initialization phase. I then stepped through the gpioHardwareRevision() function and saw the routine wasn't detecting my Raspberry Pi 3B correctly. Looks like my kernel generates a different version of /proc/cpuinfo than what pigpiod was expecting. Specifically there's no mention of "model name" in my cpuinfo:
So, while the code detected it was a rasp pi (by setting pi_ispi ==true at line 13504), we never got to look at the device tree because pi_ispi was true on line 13550. I think what was happening was that the receive socket was created , but since we were stuck waiting for hardware to initialize because the memory map wasn't configured, the daemon never called accept() and the client program hung. |
There very well may be an issue with your
The question is why? Is this unique to buildroot? |
This also might be due to me running a 64-bit kernel. Just guessing here, but it'll take me a bit to rebuild the kernel under 32-bit. I am also running on the Pi 3B+. I didn't realize the distinction until I started poking around a bit. |
For reference, when using my patch:
|
For reference, on my Pi 3B+:
It seems that the string 'CPU architecture' identifies the kernel architecture in lieu of 'mode name' from the output of |
@jkeller1ca , I'll be marking this as a duplicate of #266 but if not for your detailed analysis I would not have understood the issue. I think I do now and will be working on a patch soon. |
My pleasure! Clicky relays all over the world thank you. |
@jkeller1ca , May I request that you download the proposed patch for this issue and test it on your system?
Test your system as normal. If for some reason it fails, capture the initialization log by doing the following:
Thank you very much! |
Easy enough! I downloaded v7301.zip and temporarily added it to my buildroot setup so that it would be built the same as the original program. Using the same '-n -l 127.0.0.1' command line, both node-red and pigs were able to connect to the server just fine! That patch seems to work for me! Thanks, @guymcswain |
I appreciate the quick feedback! I'm going to wait until I get more testing feedback, both from arm64 and 32bit users. It may be until early February before I finally merge into master. Until then you've got the very latest with v7301. |
I built my version of pigpio under buildroot and used the raspberry pi 3B default configs. Unfortunately, pigpiod just hung on startup (as well as any client like node-red or pigs).
This is against v73 and linux 4.19-75 64-bit. I tracked it down to a failure in gpioHardwareRevision(). While the board is detected as a raspberry pi, the /proc/cpuinfo file seems to have changed format.
I'm ready with a patch to get it working, we just needed to add a new case in the switch statement that checks for revision. Works like a charm!
The text was updated successfully, but these errors were encountered: