PHP blues

Well this has really floored me. I am writing some PHP code to extract a list of waiting eQSLs and send replies where they match records from my log. In essence this is all straightforward but I have run into an issue that I as yet cannot resolve cleanly. There is some interaction I’m not seeing.

The eQSL API is a ColdFusion script accessed via crafting a URL with username and password. This returns a web page while at the same time preparing a list of waiting eQSLs as both an ADIF and a text file. I want the text file. The returned page has links to both and the files are not protected. When carried out by hand one clicks the link and the file is returned in the browser.

An ideal method to be automated and the kind of thing I’ve been doing since around the mid-1990s.

So, my PHP code first sends the API request and gets the returned webpage via cURL. It parses the page and extracts the URL of the text file that is the list of eQSLs. And it is here that it falls apart. When I pass this URL to another cURL procedure and thence a parser to extract the cards it always returns a 404 error.

Now the funny part. If instead of continuing in the code and using cURL to grab the produced text file I pass the URL via a system() call to another PHP program that contains the next cURL and parser that works just fine every time. And it’s the same variable I used to continued fail, or to call via system() and work, so the URL in it is correct.

I wondered at first if the ColdFusion code does not actually produce the file – or close the file – for a few seconds. But adding a delay did not work. So, does the remote code not finish things off while the network connection persists? I added various code to the two cURL processes to, in theory anyway, ensure the connection is closed after the first one. No joy.

If I simply print the URL of the download file and paste it into a browser, or into a different browser it all works. It just will not work from within that first script.

I can live with this but it’s nagging me… why is this happening? What else is PHP doing in the background that means that if I close the code and reopen another it all works? This has crept outside both my knowledge and experience! This is of course no fault of eQSL and stems from my desire to make things just the way I like them.

More stuff to fiddle with

Armed with the LF converter I have been experimenting with antennas for the low side of things. There is far too much electronic hash in the house for any hope of receiving things so I now have a couple of antenna options to try outdoors. Given the radios are all upstairs and there is no easy cable route to the workshop where the antennas can go this means a remote SDR. There is already Ethernet in the garage where the QO100 transceiver was so experiments can begin.

Anyway, here are the new fiddleables… an IP35 mini whip from eBay seller radio.el32 complete with bias tee:

This comes as the two PCBs – antenna and bias tee – plus 3 BNC sockets. The metal box was sourced from eBay and the waterproof plastic housing from Amazon. It’s a lot bigger than is needed but should be fine.

And a ‘loop antenna amplifier’ (LAA++) and bias tee from Cross Country Wireless:

All being well the first test will be of the IP35 antenna once mounted on a wooden pole. The LAA++ will take me a little longer as I need to make a loop for it.

FT817++

Getting closer to being portable – not that I go anywhere! I now have an LDG Z817 automatic tuner. It seems to be working fine although it arrived with dead batteries, one of which had leaked a bit. That cleaned up ok and it now sports a set of Energizer Max batteries (ok, I had a box…)

Having run up FT8 on the Mac 40m was packed but I did manage a contact with an EA station on 80m with 2.5W via the random bit of wire in the loft.

Note to self: remember there are batteries in it!

Going down…

My vision, if I even have such a thing is constantly going up in frequency. I am (still!) assembling various bits of microwave gear currently aiming at 10GHz. (EME would be nice, but, baby steps…). Lower frequencies are also interesting me and to that aim I now have a VLF converter which takes 50-500kHz and makes 4.0 to 4.5MHz. After throwing a bit of wire out the window I can pick up Radio 4 – which, of course I can do on just about any old thing (!) but it proves it works. Hopefully this will put SAQ on my radar, but more importantly the 136kHz and 472kHz bands – receive only for now.

The bit of random wire was particularly useless of course, but sufficient to pick out speech on 198kHz.

Twice FT8

Having two radios, two SignaLinks and multiple computers I figured why not spread a little… so here’s 4m FT8 from the FT450D and transverter plus 2m FT8 from the FT817. Well, it would be rude not to use both together…

Mind you, the poor old i7 MacBook Pro does seem to have a whinge if I dare do something else at the same time – it seems to temporarily forget the USB and gives a rig control error. On the other hand it is quite convenient to have the Mac set up as now because it is always on and I can very quickly get onto 2m FT8 (or indeed 70cm FT8 but my best QSO so far has been all of 7km!)

70cm FT8

My first FT8 on 70cm. Only 25km, but still a first for me. No reply sadly, so no QSO this time. At the time I sent a few CQs while watching pskreporter and seeing nothing. I checked this morning just out of interest and there was this one reception report.

This was via the FT817 and 2.5W into a 70cm big wheel, which isn’t at all big at that frequency! I had only just installed it which itself was a bit of a comedy of errors. I had some M&P cable ready for it but just never got round to making it up, so soldering iron out, BNC at the shack end, cable pushed through the hole in the ceiling, N male at the antenna end. The centre pin fell out! So, picture me managing to pull the loft end of the cable back down the ladder and across there landing floor to the shack (hard enough feeding the cable through the hole so I really didn’t want to have to pull it put again!), supporting it with my knee, soldering iron at maximum reach and more heat… the NanoVNA showed the SWR to be just right where it needed to be so all was well. And clearly too much cable to be able to do that maneuver! But it reminds me I really do need to sort my coax feeds out, and sort out the ceiling hole by fitting some trunking.

Edit: I did manage one QSO later on, at just 7km. But hey, it’s my first on 70cm FT8.

VARA HF and VarAC and USB fiddling

I had heard of VARA HF but not done anything about it because the Windows machine is not connected to the HF rig. That was cured yesterday by something I should have got ages ago – a USB switch. This switch has two USB connections aimed at connection to two PCs, and then four USB sockets for devices. So the SignalLink and the USB adapter for CAT control are now plugged into this switch which shares these between the Linux and Windows PCs. It all seems to work fine with USB devices connecting and disconnecting and, fortunately for Windows anyway appearing in the same place. It took me a whole to figure out that the CAT control, ends up as COM6 on the Windows box but so far it has not decided to change when reconnected.

Now the Windows box can see the FT450D I tried WSJT-X – no issues there, and it provided a good end to end test. I downloaded VarAC and the VARA HF modem. Installation went fine and almost straight away it decoded a beacon on 14.105. Since then it has been decoding numerous other beacons and a few CQ calls but I have yet to answer one. No time right now and I don’t want to use this for short FT8-like overs. I did send a few beacons and pskreporter showed that I am being received. Nice.

I have yet to get CAT working though. I don’t know what the issue is there as everything is set the way it should be so I am tuning the rig by hand until then. PTT is via the SignaLink which will do vox so tx works anyway. (Update: CAT now works fine – I had not set RTS and DTR to High in the CAT Configuration section despite it being that way in the pics in the documentation…)

And there is an issue I missed at first – VarAC plays sounds on events so the right would occasionally transmit for a bit of a second – Settings -> Appearance and Sounds and unchecking ‘Play application sounds (…)’ sorted that out.

I did notice one thing though. When I turn the Linux machine on it is generating noise on 20m. The Linux and Windows machines are essentially identical so something is causing pickup. I’ll need to unwind all the cables and add ferrites – a useful indication hopefully easily fixed. There are now far too many cables and all in a mess!

Zigbee

I have always dabbled in home automation, pretty much since before it even became a thing. Most of the control was, and mostly still is via X10 devices and controllers which use mains signalling. This is rather old fashioned now and, being mains signalling is susceptible to interference. At one stage the outdoor light, which are controlled via an X10 appliance module in the workshop were very intermittent, until I discovered the wall-wart on one of the internal cameras was injecting awful noise that caused a scanner AM to buzz wildly when held near any mains outlet in the house!

Anyway, that isn’t radio related, but this is… enter Zigbee. I have not read very far into this yet but it uses 2.4GHz among other frequencies for its signalling and there are lots of modules available. I plan to change our two dimmers to Zigbee and it will be pretty much plug and play. Apart from removing the mains signalling path the modules communicate both ways, so the controller can see their status as well as control them. Some of the newer X10 modules do this but very few of them and none of the ones I have.

The current setup here is a Raspberry Pi running Homebridge which appears in the Apple Home app and can respond to commands via Siri. The X10 lighting controllers are handled via shell scripts which are called by a Homebridge plugin. But with no status return, if the lights are switched on by a switch or, in the case of the garden and outdoor lights via a script which calculates dusk and dawn the Home app has no clue as to their state. With Zigbee it will.

There is a little way to go yet but everything appears to work. The Homebridge software has a plugin that communicates with software on the server which in turn works via a Zigbee 2.4GHz USB dongle. Basically, with very little work new devices feed their names all the way back to the Home app. All I need now is some more!

Categories

Tags

Recent Posts

Archives

Links