RedBear Compatibility


#1

I know its not something you manufacture, but the team at Pi Wars asked me to post this which I first posted on the RasperryPi.org forum, concerning the compatibility of a RedBear IOT pHAT (which gives the original Pi Zero a wireless capability without using a USB wireless dongle) with code such as Servoblaster. Unfortunately, the Servoblaster code by default drives some of the pins which the pHAT needs for talking to the wireless chip. These advanced compatibility problems are quite concerning, because the Pi Zero becomes almost unusable until the servoblaster service can be stopped :

“My RedBear IOT pHAT works OK, but of course has now been superseded by the PiZeroW. I am trying to use servoblaster on my PiZero, and the default setup causes constant interrupts that use over 95% of cpu time on irq/86-mmc1. Managed to stop the service (not quite sure how), and then a reboot got everything working. Need to set the used GPIO in servoblaster so it doesn’t upset the PHAT when it starts up from initial boot.”


#2

either I completely misunderstand the question or you just need to pass a pin array that does not clash with the IoT pHAT when using servoblaster?

for example --p1pins=19,21,23,24 would drive 4 servos on bcm8-11 without creating issues? not tried, or for that matter used servoblaster at any point, so that may be naive of me to think that is all that would be needed (but then, the documentation implies as much).


#3

Hi RogueM
Yes you are correct, but I think you have to do that each time you use it. The documentation doesnt say anything about getting it set up correctly in the first place. It starts up with PWM signals that cause problems. Once it is wrong, it’s difficult to get into the Pi without a reset. I havn’t yet studied the code to have it boot up correctly.


#4

hum, it would be trivial to set up a systemd unit to kickstart servod with the right options (or even a basic cronjob).

Pretty sure that is the intend, it even seems to imply there might be a config file that may allow the default to be as needed for a particular situation. That would presumably include switching to pcm?


#5

I had a quick look and AFAICT the only thing you’d have to do is amend the OPTS patameter in the supplied init script:

whether you change that before compiling/install or later does not really matter, although it seems, unhelpfully, that the install script kicks the service in, so modifying the source might make sense.

… I can see no reference to a pref/conf file, but it wouldn’t be too hard to externalise, if needed.


#6

but I think I understand your issue better now… indeed, because the service is started as part of the makefile, if your backdoor into the Pi is the pHAT you’d be in for a treat.

IMO it is an oversight of the install process, and just taking out line14 in the Makefile and require a reboot*, giving users at least a fighting chance to remove any potential pin conflict or other configuration issue, would make sense.

*or manually starting the servoblaster service the first time.


#7

Hi Rogue

Thanks for looking into this. I will try editing the script and see what
happens. I am not very ‘au fait’ with this part of linux - being an
engineer rather than a system programmer.

cheers
Tony