Sunday, March 07, 2021

Packet Radio, Part 3 (RasPi interface)

Jameco order arrived, and yes I was like a kid at Christmas!  Not even a little bit embarrassed...

Verified that the 6-pin DIN cable fit into FT-8900R, and got the other end into the DIN socket, (although not without a bit of fiddling; I guess it'll plug easier over time).  Got the Adafruit T-Cobbler plugged into the breadboard just fine; got the cable plugged into the T-Cobbler easily (because the notch makes it obvious which way it should go).

Now to the other end.  Huh, the RasPi 3B+ GPIO pins are just pins, no socket with a notch to know which way it goes.  Guessing the the cable should point off the Pi board, but I'm not so very fond of guessing.  Looked on the Adafruit page, but they had no pictures of the cable installed on a Pi (that I could find, anyway).  Googled it, and found this video, that made it clear that my guess was correct; thanks, vid guy!

Assembled the transistor circuit on the lower part of the breadboard.  (Slightly worried that when I get to putting the 555 on there, it's gonna be crowded, but we'll sort that out when we get to that point.)

Into Direwolf config, and added line with "PTT GPIO 25".  Direwolf started up without error, and without the message that I used to get about PTT not being configured; so that's a good sign.

Hmmm, now I'm ready to test a transmit, and realizing that I don't think I've ever figured out how to tell Direwolf to transmit.  All my previous play was just to get Direwolf to decode received signals, and that all worked easily enough (IIRC).  Looked around the User Guide, and saw mention of protocols and software, and YAAC was familiar from one of Josh's videos.

So I got YAAC fetched and installed on my Win10 laptop.  I already had Java running, from various past projects, and once unzipped, could just double click the YAAC.jar and have it launch.  Walked through the guided setup, then went into expert mode and changed the (Transmit tab) 'beacon destination' and (Beacon tab) 'beacon type' and 'enable station beacon' settings.

YAAC's (Beacon tab) lat/long setting is irrelevant for today's test, but I verified that it was set correctly from guided setup, and saw that the map display was actually centered on my house, which is cool.  I love maps :).

And then I added an entry on the Ports tab, to point Win10 to RasPi.  First try was using AGWPE mode, but while that connected to RasPi, Direwolf gave error messages on every connect.  Deleted that entry, and tried a KISS-over-TCP port, and it worked first time.

Well, at least it connected to Direwolf, which displayed an APRS beacon line.  Pretty cool, by itself.  But my circuit lights didn't blink.  What am I missing?  Time to walk through what I know is working, to where it might not be.  Direwolf thinks it's using GPIO 25, or at least isn't complaining that it can't.  Is RasPi swallowing the request to raise GPIO 25 pin?

Back to the docs, and found this page that talked about the current RasPi user needing to be in the gpio group.  But I'm logged in as the 'pi' user, and 'groups' command showed 'gpio' is already there.  So that should be good.

Went looking for sample code, to test.  Found this code in Python to toggle a pin on/off.  Quick vi edit session, and ran the code, and still no blinking lights.  Hrm.

Time to look over the circuit again.  +3.3vdc through one LED/resistor to base of transistor.  GPIO 25 through the other LED/resistor to collector of transistor.  Emitter of transistor to ground rail on breadboard.  <facepalm> ... and I forgot to connect the ground rail to a GND pin on the RasPi!  One more lead in place, rerun the Py code, and ... lights!  They are blinking!

Ok, kill the Py code (do multiple processes fight over GPIO access?), restart Direwolf, back to YAAC, and now it's not talking to Direwolf.  Went into YAAC config, edited the port, changed nothing, just resaved, and YAAC reconnected and sent beacon to Direwolf, which triggered GPIO 25, which blinked the lights!  (Guessing that "proper" operation, then, is to run Direwolf, then YAAC, and life would be fine.)

Well.  That was a wall of text.  Hoping it helps someone, in some way.  At this point, I think maybe I'm 1/3 of the way through the wiring effort.  I do still want to add the 555 chip to the circuit, and then of course hook up the DIN socket and audio lines, so that I'm actually pushing PTT on the radio and sending a signal out.  The ultimate smoke test here will be firing up YAAC and seeing a current report on aprs.fi.  And once that's working, to be able to actually connect to a packet bbs, and do other fun stuff.  But that'll be for another day (or at least another post)...

No comments: