Quantcast

GPIO "wears out..."

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

GPIO "wears out..."

Joe Erlewein N8CN
Hi everyone,

Last week I built a new Raspian image on an Rpi2 rev B.
uname -a says:
Linux N8CN-R 4.1.13-v7+ #827 SMP PREEMPT Tue Dec 8 20:29:06 GMT 2015 armv7l GNU/Linux

I followed a couple (older) online guides I found for the DL and config of svxlink. Kept notes in Evernote of everything I did.

I had real troubles getting things working compared to the image I came from.
Weird ones, too, like COR input sense being inverted.

On the older unit, GPIO=gpio23 worked for Rx1 for instance.
On the new one, I had to change it to GPIO=!gpio23 and then it works as normal.

PTT GPIO outs didn’t seem inverted. Strange, I know.

So, here’s what I’m running into.

I have rc.local containing:

#Rx1 COS
gpio mode 22 in
echo "22" > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio22/direction

#Rx2 COS
gpio mode 23 in
echo "23" > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio23/direction

#Tx1 PTT
gpio mode 17 out
echo "17" > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction

#Tx2 PTT
gpio mode 27 out
echo "27" > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio27/direction

#start engines manually because i haven’t edited init scripts
service svxlink start


So, this works great. Then I’ll notice that Tx2 stops transmitting after an hour or so.
if I tail /var/log/svxlink, svxlink THINKS it is transmitting.

if I echo /sys/class/gpio/gpio27/value
it is normally 1 when transmitting, 0 when not.
when whatever happens happens, the value is always zero. it’s like svxlink “loses access” to control GPIO.

Then some time later, I’ll notice Tx1 has also stopped.
Same symptoms, log says it’s transmitting, but value for /sys/class/gpio/gpio17/value is always 0.

I’ve just done rpi-update, thinking it might be firmware related.

A reboot fixes things, as does sourcing these lines from rc.local:
echo "27" > /sys/class/gpio/export
echo "17" > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction
echo out > /sys/class/gpio/gpio27/direction

Why this is only happening to my GPIO outputs? no idea. Inputs seem to work fine (other than being inverted..)

Linux N8CN-R 4.1.17-v7+ #834 SMP Mon Feb 1 15:17:54 GMT 2016 armv7l GNU/Linux

Ideas?



-Joe
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GPIO "wears out..."

David Ranch-3

How are you connecting your Raspberry Pi's GPIO pins to your radio?  Directly?  If so, you could be drawing too much current through the GPIO pins.  Consider using a simple transistor circuit to buffer the GPIO pin.  There are *lot* of examples out there but here is one:

   http://www.twotonedetect.net/raspberry-pi-simplex-repeater-the-peaterpipyr/

--David
KI6ZHD

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GPIO "wears out..."

Joe Erlewein N8CN
Thanks David - good suggestion! 
(But, I’m already doing that)

I’m convinced it’s something software-related that I just forgot to do..
If I switch back to the other (older version) SD card it works without this issue.
(frankly, that OS/installation is a mess and my goal was to build a new install on a new card to replace it)

So.. yeah. I’m sure it is something software-related. I’m not using GPIO to sink more current than the 2n2222 takes to pull output down.

Thanks 

73
Joe


On Feb 6, 2016, at 3:31 PM, David Ranch <[hidden email]> wrote:


How are you connecting your Raspberry Pi's GPIO pins to your radio?  Directly?  If so, you could be drawing too much current through the GPIO pins.  Consider using a simple transistor circuit to buffer the GPIO pin.  There are *lot* of examples out there but here is one:

   http://www.twotonedetect.net/raspberry-pi-simplex-repeater-the-peaterpipyr/

--David
KI6ZHD
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GPIO "wears out..."

Joe Erlewein N8CN

I think I found out what is happening.

It’s something with the init script. (it is the same one posted at https://github.com/sm0svx/svxlink/blob/master/distributions/debian/etc/init.d/svxlink ) 

Things seem to work if the raspberry pi is freshly booted.

“service svxlink stop” works.
“service svxlink start” works.. once. and when it works that one time, I lose Rx2 PTT GPIO. Rx1/Tx1 seem to operate normally.
If I stop and start again, neither Rx1, Tx1, Rx2, or Tx2 work.

out of desperation, I finally (accidentally) left off an argument and got a list of arguments:
root@N8CN-R:~# service svxlink
Usage: /etc/init.d/svxlink {start|stop|restart|try-restart|force-reload|gpio|status}

naturally, I tried “status”
root@N8CN-R:~# service svxlink status
● svxlink.service - LSB: Start svxLink Server daemon
   Loaded: loaded (/etc/init.d/svxlink)
   Active: active (running) since Mon 2016-02-15 14:07:30 EST; 37min ago
  Process: 879 ExecStart=/etc/init.d/svxlink start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/svxlink.service
           └─890 /usr/local/bin/svxlink --daemon --logfile=/var/log/svxlink --config=/usr/local/e...

Feb 15 14:07:30 N8CN-R svxlink[879]: Starting SVXLINK server: svxlink.
Feb 15 14:07:30 N8CN-R systemd[1]: Started LSB: Start svxLink Server daemon.

That’s neat and all.

But the real revelation came when I used the “gpio” argument:
root@N8CN-R:~# service svxlink gpio
/etc/init.d/svxlink: 187: [: /sys/class/gpio/gpio17: unexpected operator
Uninitialize PTT GPIO: gpio17 27 [GPIO PTT #17].
/etc/init.d/svxlink: 197: [: /sys/class/gpio/gpio22: unexpected operator
Uninitialize Squelch GPIO: gpio22 23 [GPIO SQL #22].

So, Rx1 COS is 22, Rx2 COS is 23, Tx1 PTT is 17, Tx2 PTT is 27

from /etc/init.d/svxlink: 
# /etc/default/svxlink support following options:

Ok. so what’s in there? this:
#GPIO_PTT_PIN="17 27"
#GPIO_SQL_PIN="22 23"

if [ -r /usr/local/etc/svxlink/svxlink_gpio.conf ]; then
        . /usr/local/etc/svxlink/svxlink_gpio.conf
fi


Ok.. a test and reference to /usr/local/etc/svxlink/svxlink_gpio.conf

what’s in there? this:

root@N8CN-R:/usr/local/etc/svxlink# more svxlink_gpio.conf
# GPIO_PTT_PIN="<num> <num>"
#     <num> defines the GPIO pin(s) used for PTT / TX.
# GPIO_SQL_PIN="<num> <num>"
#     <num> defines the GPIO pin(s) used for Squelch (COS) / RX.

GPIO_PTT_PIN="17 27"
GPIO_SQL_PIN="22 23”



And… that’s it. Just like the init script asks for. spaces, not commas, not multiple incantations.

(I tried these without success:
GPIO_PTT_PIN=“17,27"
GPIO_SQL_PIN=“22,23”
//
GPIO_PTT_PIN="17"
GPIO_SQL_PIN="22”
GPIO_PTT_PIN="27"
GPIO_SQL_PIN=“23”
//
no luck)

So, it looks like the script isn’t properly handling my GPIO conf.

Anything more than what I’ve been able to figure out (the above) starts to go a little over my head.

Can someone bump me in the right direction?

Thanks!

Joe


(SvxLink v1.5.0)





On Feb 6, 2016, at 21:30, Joe Erlewein <[hidden email]> wrote:

Thanks David - good suggestion! 
(But, I’m already doing that)

I’m convinced it’s something software-related that I just forgot to do..
If I switch back to the other (older version) SD card it works without this issue.
(frankly, that OS/installation is a mess and my goal was to build a new install on a new card to replace it)

So.. yeah. I’m sure it is something software-related. I’m not using GPIO to sink more current than the 2n2222 takes to pull output down.

Thanks 

73
Joe


On Feb 6, 2016, at 3:31 PM, David Ranch <[hidden email]> wrote:


How are you connecting your Raspberry Pi's GPIO pins to your radio?  Directly?  If so, you could be drawing too much current through the GPIO pins.  Consider using a simple transistor circuit to buffer the GPIO pin.  There are *lot* of examples out there but here is one:

   http://www.twotonedetect.net/raspberry-pi-simplex-repeater-the-peaterpipyr/

--David
KI6ZHD
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GPIO "wears out..."

Joe Erlewein N8CN
Does anyone have an example of a working init script for SVXLINK on an Raspberry Pi 2 with GPIO ?

Thanks-
Joe


> On Feb 15, 2016, at 14:53, Joe Erlewein <[hidden email]> wrote:
>
>
> I think I found out what is happening.
>
> So, it looks like the script isn’t properly handling my GPIO conf.
>
> Anything more than what I’ve been able to figure out (the above) starts to go a little over my head.
>
> Can someone bump me in the right direction?
>
> Thanks!
>
> Joe
>
>
> (SvxLink v1.5.0)
>


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GPIO "wears out..."

Robert
Would you show what you have in your script.

Robert Grimes

> On Feb 29, 2016, at 2:12 PM, Joe Erlewein <[hidden email]> wrote:
>
> Does anyone have an example of a working init script for SVXLINK on an Raspberry Pi 2 with GPIO ?
>
> Thanks-
> Joe
>
>
>> On Feb 15, 2016, at 14:53, Joe Erlewein <[hidden email]> wrote:
>>
>>
>> I think I found out what is happening.
>>
>> So, it looks like the script isn’t properly handling my GPIO conf.
>>
>> Anything more than what I’ve been able to figure out (the above) starts to go a little over my head.
>>
>> Can someone bump me in the right direction?
>>
>> Thanks!
>>
>> Joe
>>
>>
>> (SvxLink v1.5.0)
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> Svxlink-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/svxlink-devel


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GPIO "wears out..."

Joe Erlewein N8CN
Sure, (i trimmed the length of my last reply, but in the one before that I linked to the init script I use)

I am using the init script located here:
If you want I can paste it but was trying to keep my (longer than it should have been) post a little shorter. :)

73— and thanks!! 
Joe




On Feb 29, 2016, at 16:57, Robert <[hidden email]> wrote:

Would you show what you have in your script.

Robert Grimes

On Feb 29, 2016, at 2:12 PM, Joe Erlewein <[hidden email]> wrote:

Does anyone have an example of a working init script for SVXLINK on an Raspberry Pi 2 with GPIO ?

Thanks-
Joe


On Feb 15, 2016, at 14:53, Joe Erlewein <[hidden email]> wrote:


I think I found out what is happening.

So, it looks like the script isn’t properly handling my GPIO conf.

Anything more than what I’ve been able to figure out (the above) starts to go a little over my head.

Can someone bump me in the right direction?

Thanks!

Joe


(SvxLink v1.5.0)


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Loading...