LIGHTING UP A NEW YEAR For the end of my month mostly-not-off, I finally let myself waste New Year's Eve and Day on something completely pointless - the optical communication experiments I didn't get reading in time for ROOPHLOCH, as mentioned in 2024-10-01ROOflop.txt. As a result this post will hopefully be transmitted by light before being received and automatically uploaded to aussies.space. Actually it's being sent and received by the same computer at the moment, which is rather pointless, but it makes it easier to debug. It's all still just a bird's nest of breadboards on my workbench. I was hoping to start on the cases for the transmitter and receiver today, but somewhat predictably got bogged down for hours trying to get the software configuration right. Most things worked quite easily, but I wasn't getting the EOF character to terminate 'cat' at the end of the file, whereafter the file gets automatically uploaded to aussies.space by the receiver computer. The description in the stty man page really doesn't suggest it, but by trial and error I eventually discovered that enabling the 'icanon' setting lets the EOF character (default Ctrl-D) through without messing other things up. With that sorted out I experimented with baud rates, and far from pushing the limits at 200 baud I can get up to 4800 baud over the short distance of my test rig. Since I'm aiming for sensitivity rather than bandwidth that's far more than sufficient. So I set to writing up some transmit and receive scripts to use to post to the phlog. Even though the stty documentation caught me out, I do think it's wonderful how short the shell scripts to do this can be: optictx.sh ------------------------------------------------------------------ #!/bin/sh # optictx.sh [file] [serial device] [baud rate] # eg. optictx.sh hello.txt /dev/usb/ttyUSB0 4800 FILE="$1" DEV="$2" [ $3 ] && BAUD=$3 || BAUD=200 stty -F $DEV raw icanon -crtscts -echo $BAUD || exit echo " Transmitting $FILE at $BAUD baud..." cat "$1" > $DEV echo -e '\x04' > $DEV ------------------------------------------------------------------ opticrx.sh ------------------------------------------------------------------ #!/bin/sh # opticrx.sh [filename] [serial device] [baud rate] # eg. opticrx.sh hello.txt /dev/usb/ttyUSB0 4800 FILE="$1" DEV="$2" [ $3 ] && BAUD=$3 || BAUD=200 HOST=ausshell DEST=/home/freet/goph/phlog CMD="cd /home/freet/goph/phlog && /home/freet/bin/simplemkphlog.sh" stty -F $DEV raw icanon -crtscts -echo $BAUD || exit echo " Receiving $FILE at $BAUD baud..." cat $DEV > "/tmp/opticrx_$FILE" echo " Uploading..." pscp -C -sftp "/tmp/opticrx_$FILE" "$HOST:$DEST/$FILE" plink -C -batch "$HOST" "$CMD" echo " Operation Complete" rm "/tmp/opticrx_$FILE" ------------------------------------------------------------------ A photo of my test set-up, transmitting a pretty modest 47cm distance from red LED array to photodiode lens, but I'm sure it can go much further: gopher://aussies.space/I/~freet/photos/optical_comms/bench_test.jpg See the 2024-10-01ROOflop.txt for the circuits. I forgot to include the pull-down resistor on the output to the RS232 TTL adapter from the receiver board, which I've added there now, but otherwise nothing's changed. Soldering up the boards properly should be easy, but the cases are going to be tricky to work out because they have to fit on top of my tripods. Maybe I'll get to that on the weekend. Best not put it off and accidentally let yet another ten months pass me by before ROOPHLOCH 2025. Still tonight it will be shifted aside yet again to make way for tomorrow's work, hopefully after successfully sending this. In other news, not so much doof-doof music from the festival this year, it seems. Maybe that style's on its way out? Only those lower pitch sounds carry this far so it mostly seemed quieter this year. They had a fireworks display which I went outside to watch but it was more of a colourful glow at this distance, even through my wonky highest-magnification binoculars. Just as the display ended the faint sound of the new year's countdown reached me, delayed by the distance. I didn't get around to buying booze for my permitted single day of alcohol consumption in 2024 (any day, but only once per year), having finally exhausted stocks. But in a way my apathy there is exactly the intended result of my rule. Alright, let's see if this works... Nope, stty is still confusing me. Adding '-echo'... - The Free Thinker