Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; WpFlickrEmbed has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/plugins/wp-flickr-embed/wp-flickr-embed.php on line 34

Warning: session_start(): Cannot start session when headers already sent in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/plugins/wp-flickr-embed/include/class.flickr.php on line 104

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/plugins/wptouch/core/class-wptouch-pro.php on line 1623

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/load.php on line 926

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/functions/media.php on line 666

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/functions/media.php on line 671

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/functions/media.php on line 684

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/functions/media.php on line 689

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/functions/media.php on line 694

Notice: Trying to access array offset on value of type bool in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/theme.php on line 2360

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Suffusion_Widgets has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/widgets/suffusion-widgets.php on line 10

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Suffusion_Search has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/widgets/suffusion-search.php on line 9

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Suffusion_Follow_Twitter has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/widgets/suffusion-twitter.php on line 10

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Suffusion_Category_Posts has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/widgets/suffusion-query-posts.php on line 10

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Suffusion_Featured_Posts has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/widgets/suffusion-featured-posts.php on line 10

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Suffusion_Google_Translator has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/widgets/suffusion-translator.php on line 10

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Suffusion_Subscription has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/widgets/suffusion-subscription.php on line 20

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Suffusion_Flickr has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/widgets/suffusion-flickr.php on line 10

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Suffusion_Query_Users has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/widgets/suffusion-query-users.php on line 10

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Suffusion_Child_Pages has a deprecated constructor in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/themes/suffusion/widgets/suffusion-child-pages.php on line 10

Warning: Cannot modify header information - headers already sent by (output started at /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-content/plugins/wp-flickr-embed/wp-flickr-embed.php:34) in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/feed-rss2.php on line 8
rtn VFRmedia https://ratcotel.net welcome to the secret goose shed Fri, 30 Jun 2017 20:02:39 +0000 en-GB hourly 1 https://wordpress.org/?v=5.2.11 Converting between text encoding schemes with Python https://ratcotel.net/?p=437 https://ratcotel.net/?p=437#comments Fri, 30 Jun 2017 20:02:39 +0000 http://ratcotel.net/?p=437 [...]]]> This small thermal printer is very basic and uses 1980s style ESC/POS control codes (like most similar printers of this type that are used in shops for receipt printing). Sending UTF-8 text directly to it (such as any accented characters) doesn’t work well, as the accented characters have different codes (this printer can use a variety of old DOS code pages but defaults to 437).

Luckily Python has all these text conversion functions built in (you don’t even need to roll your own lookup tables!)

# # # convert UTF-8 to codepage for thermal printer # # # this is UTF-8 text with German characters # import pprint import serial # # USB converter device name for thermal printer # ttyname = 'COM2' text1 = [ 'Sie kam als Kind\nwohl am Sonntag an,\n', 'denn sie hieß,\nseit ich denken kann,\n', 'immer nur Sunday Girl.\n', 'Sie war nie Schuld,\nganz egal woran,\n', 'ihr hat nie etwas weh getan,\n', 'denn sie war Sunday Girl.\n\n', 'Kalt wie Eis und genau so süß\n', 'so war sie und auch manchmal\nganz schön mies.\n', 'Für sie war es ein Kinderspiel,\n', 'pech für den, dem sie gefiel.\n', ] # # convert output to list of bytes with codepage # using printers default codepage 437 # opt =[] for i in range(len(text1)): byt = str.encode(text1[i],'cp437') opt.append(byt) # # open the printer port and send data # s=serial.Serial(ttyname,19200) # # centre the title text and bold it # s.write(b'\x1ba1\x1bE1') s.write(b'Text conversion test\n\n') s.write(b'\x1ba0\x1bE0') # print the converted text for i in range(len(opt)): s.write(opt[i]) # # done, print complete message # s.write(b'\x1ba1\x1bE1') s.write(b'\n\nComplete...\n\n\n') s.write(b'\x1ba0\x1bE0')
textconv.py


]]>

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
https://ratcotel.net/?feed=rss2&p=437
1
Control the Arduino pager TX via Python.. https://ratcotel.net/?p=422 https://ratcotel.net/?p=422#respond Thu, 22 Jun 2017 19:22:39 +0000 http://ratcotel.net/?p=422

Python3 code is below…

also available at this Gitlab link

https://gitlab.com/Alex-rtnVFRmedia/pagertest2

Control the Arduino pager TX via Python running on a Linux machine

# control the Arduino RF22 pager TX # modified ON1ARF code # # 2017-06-23 Alex The Engineer # The Rat's Nest, Ipswich UK # # import serial import pprint import sys from colorconsole import terminal from colored import fg, bg, attr import readline # global colours res=attr('reset') # tty open now coded as a function # # colored module used here instead of colorconsole/screen object # just in case there isn't a global screen object available # def page(ttydev,capcode,function,repeats,message): # # create msg bytearray (NB: there should be more error # checking here # msg=(b'P ') msg+=(b'%07d' % capcode)+(b' ') msg+=(b'%01d' % function)+(b' ') msg+=(b'%01d' % repeats)+(b' ') msg+=(message)+(b'\r') print (fg(80),bg(0x12),'** opening tty:',ttydev+res) # serial port open with error checking this time try: ser = serial.Serial(ttydev, timeout=3) except serial.SerialException: print(res) sys.exit("** ERROR: cannot open tty\n\n") # if we got here everything is OK # RTS/DTR does not actually need to be flipped # as opening the tty does that anyway # which saves some time starting up the arduino comms # ser.setRTS(True) # ser.setRTS(False) # # get the lines from the buffer print (fg(0x0b),bg(0x15),'** tty open OK: >>check TX<<'+res) ibuf = ser.readlines() print (fg(202)) #pprint.pprint(ibuf) print (' ibuf[0] :',ibuf[0]) print (' ibuf[-1] :',ibuf[-1]) # check to see what came down comms line is expected if ibuf[0] != (b'RF22 init OK\r\n'): print(res) sys.exit("** ERROR: RF22 init error\n\n") if ibuf[-1] != (b'F <freqmhz> <freq100Hz>\r\n'): print(res) sys.exit("** ERROR: RF22 comms error\n\n") # if TX has correctly initialised now send message ser.write(msg) # get a line back from TTY, it should be exactly same as msg # but with a \n after it # if it hasn't something has gone wrong check=ser.readline() print(fg(0x50),'<< from tty:',fg(0x72),bg(0x08),check,res,fg(0x52)) if check != (msg+b'\n'): print(res) sys.exit("** ERROR: pager comms error\n\n") print (' ++ comms to pager TX OK ++') # get data returned over comms link # and now echo it with some pretty colours 🙂 colindex=0x70 while True: data=ser.readline() # only print it if a sending confirmation if data==(b'POCSAG SEND\r\n'): print (fg(0x30),'<< from tty:',fg(colindex),data) colindex += 1 if data==(b'F <freqmhz> <freq100Hz>\r\n'): break # all done, close tty print (fg(0x28),'** message sent correctly **\n') ser.close() def header(scr): scr = terminal.get_terminal(conEmu=False) scr.clear() scr.xterm256_set_fg_color(0x52) scr.xterm256_set_bk_color(0x08) scr.print_at(2,0,"rtn telecom : pagertest 1.00") scr.xterm256_set_bk_color(0) scr.gotoXY(2,3) scr.xterm256_set_fg_color(0x20) print('capcode:') scr.xterm256_set_bk_color(0x08) scr.xterm256_set_fg_color(0x78) scr.gotoXY(10,3) print(' ') scr.xterm256_set_bk_color(0) scr.gotoXY(20,3) scr.xterm256_set_fg_color(0x20) print('alert:') scr.xterm256_set_bk_color(0x08) scr.xterm256_set_fg_color(0x78) scr.gotoXY(26,3) print(' ') scr.xterm256_set_bk_color(0) scr.gotoXY(2,5) scr.xterm256_set_fg_color(0x20) print('message:') scr.xterm256_set_bk_color(0x08) scr.xterm256_set_fg_color(0x78) scr.gotoXY(10,5) print(' ') scr.xterm256_set_bk_color(0) scr.gotoXY(0,9) scr.xterm256_set_fg_color(0x28) # to be developed, input capcode def get_capcode(scr,default): pass # display capcode in input box def disp_capcode(scr,capcode): scr.xterm256_set_bk_color(0x08) scr.xterm256_set_fg_color(0x78) scr.gotoXY(10,3) print (str((b'%07d' % capcode),'utf-8')) scr.xterm256_set_bk_color(0) # display alert code in input box def disp_alert(scr,alert): scr.xterm256_set_bk_color(0x08) scr.xterm256_set_fg_color(0x78) scr.gotoXY(26,3) print (str((b'%01d' % alert),'utf-8')) scr.xterm256_set_bk_color(0) # display message in input box def disp_msg(scr,message): scr.xterm256_set_bk_color(0x08) scr.xterm256_set_fg_color(0x78) scr.gotoXY(10,5) print (str(message,'utf-8')) scr.xterm256_set_bk_color(0) scr.gotoXY(0,9) # # main code now starts here # # initialise the screen # # 2017-06-23: now accepts interactive input of message # # a blank line transmits the hardcoded message # # 'q' exits the code # while True: # refresh the header screen = terminal.get_terminal(conEmu=False) header(screen) # message now split into capcode, function (0-3), repeats # and 40 character bytearray # # hardcoded values # capcode = 20008 function = 2 repeats = 1 message = b'rtn: miauw naar de maan!<<<pagertest>>>' ttydev="/dev/ttyACM0" # display the capcode and alert that are currently hardcoded # but leave the msg box blank as it now accepts user input # disp_capcode(screen,capcode) disp_alert(screen,function) # # create a quick and dirty coloured prompt for the input # screen.gotoXY(2,7) screen.xterm256_set_fg_color(0x38) print('------>') screen.gotoXY(10,7) screen.xterm256_set_fg_color(0x68) # # this uses readline so has some basic editing functions # # anything over 40 character is clipped # ms1=input() if ms1 !='': message=ms1[0:40].encode('utf-8') if ms1 =='q': break # # display the msg in the top box and transmit it # disp_msg(screen,message) page(ttydev,capcode,function,repeats,message) # # terminate script and reset all the console colours # print (fg(0xc8),'\n++ Script completed sucessfully ++\n',res)
pagertest2.py
]]>

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
https://ratcotel.net/?feed=rss2&p=422
0
Replacing mains input cable on Baofeng BF-888 UHF radio desk charger https://ratcotel.net/?p=415 https://ratcotel.net/?p=415#respond Tue, 24 Jan 2017 20:43:22 +0000 http://ratcotel.net/?p=415 [...]]]> These UHF portable radio sets are good value, [I am obtaining some for use by the janitorial and maintenance teams at work] but the supplied mains chargers aren’t the safest design – and like most similar chargers they also cook the accus if they are left on charge constantly which often happens when these sets are used by less technically minded endusers.

Update: Newer versions of this radio sold on Amazon are now supplied with a desk charger with a USB plug; it seems Baofeng have been monitoring the various comments from European users (and their modifications to the chargers) widely posted on blogs and social media (fair play to them!)

This is of course much safer and can also be used with any suitable USB power supply including cigarette lighter adapters for vehicles, but there are still a fair few units being sold with the mains powered desktop charger as well as many others in regular use worldwide.

You can also get better 6 unit chargers from HongKong which have a separate low voltage PSU (similar in size to a laptop charger) that connects to the desktop unit but in the meantime I investigated and modified one of the chargers I already have to make it slightly safer – a fiddly and awkward job due to the way this cheap charger is constructed.

ATTENTION: Don’t try this unless you are confident with working on mains voltage equipment!

Below are some pictures showing whats inside, a very simplified explanation of how this kind of charger works and why changing the cable is a good idea (I also used a better plug with a 5A fuse). The good news is that it all worked when I put the case back together (I definitely wasn’t going to attempt testing it with the live PCB exposed), and the output voltage at the terminals was correct (compared with that of an identical unit)

overview of SMPSU repair & operationoverview of SMPSU repair & operation

]]>

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
https://ratcotel.net/?feed=rss2&p=415
0
Controlling a Sparkfun thermal printer via C on Linux https://ratcotel.net/?p=401 https://ratcotel.net/?p=401#respond Sat, 17 Dec 2016 14:38:27 +0000 http://ratcotel.net/?p=401

code below

C Code to test the thermal printer and serial comms

/*=========================================================================== * Serial Port Programming in C (Serial Port Write) * Non Cannonical mode * Program writes a character to the serial port at 19200 bps 8N1 format *--------------------------------------------------------------------------- * original Programmer : Rahul.S * Date : 21-December-2014 *============================================================================ * altered by : Alex the Engineer * rtn VFRmedia the Rat's nest * Ipswich GB * to work with x86 netbook connected to Sparkfun thermal printer * via USB-TTL serial converter * Date : 2016-05-29 * 2016-05-30 : code recompiled to ZX-SL91 * (old Tosh amd64 laptop with busted keyboard repurposed as mini * server * ---------------------------------------------------------------------------- * 2016-06-10 : sourcecode formatting cleaned up a bit *============================================================================== /*-------------------------------------------------------------*/ /* termios structure - /usr/include/asm-generic/termbits.h */ /* use "man termios" to get more info about termios structure */ /*-------------------------------------------------------------*/ #include <stdio.h> #include <fcntl.h> /* File Control Definitions */ #include <string.h> /* strings */ #include <termios.h> /* POSIX Terminal Control Definitions */ #include <unistd.h> /* UNIX Standard Definitions */ #include <errno.h> /* ERROR Number Definitions */ /* global vars - probably shouldn't be hardcoded like this */ /* and some should be #defines to save memory */ /* but better than sticking them into the sourcecode */ int bytes_written = 0; /* Buffer containing characters to write into port */ char *write_buffer = "\x1b@\n\n\n" "\x1b\x0ertn\n" "telecommunicatie\x1b\x14\n" "printertest ZX-SL91\n" "\nAchtung! Achtung!\n" "The Goose is Loose!\n" "\x1d\x48\x03\n"; char *msg2= "\x1b@" "rtn :miauw naar de maan!\n\n\n\n\n"; char *barcode128n= "\x1d\x6bI"; char *item1= "2815 doedelzak"; char *item2= "9502 asbak "; char *item3= "7281 snakeoil "; char *lin_adv= "\n"; int main(void) { int fd; /*File Descriptor*/ printf("\n +----------------------------------+"); printf("\n | Serial Port Write |"); printf("\n +----------------------------------+"); /*------------------------------- Opening the Serial Port ------*/ /* Change /dev/ttyUSB0 to the one corresponding to your system */ fd = open("/dev/ttyUSB0",O_RDWR | O_NOCTTY | O_NDELAY); /* ttyUSB0 is the FT232 based USB2SERIAL Converter */ /* O_RDWR Read/Write access to serial port */ /* O_NOCTTY - No terminal will control the process */ /* O_NDELAY -Non Blocking Mode,Does not care about- */ /* -the status of DCD line,Open() returns immediatly */ if(fd == -1) { /* Error Checking */ perror("\n Error! in Opening ttyUSB0 "); return -1; } else perror("\n ttyUSB0 Opened Successfully "); /* set tty attrs 19200 8N1 */ struct termios SerialPortSettings; tcgetattr(fd, &SerialPortSettings); cfsetispeed(&SerialPortSettings,B19200); cfsetospeed(&SerialPortSettings,B19200); SerialPortSettings.c_cflag &= ~PARENB; SerialPortSettings.c_cflag &= ~CSTOPB; SerialPortSettings.c_cflag &= ~CSIZE; SerialPortSettings.c_cflag |= CS8; SerialPortSettings.c_cflag &= ~CRTSCTS; SerialPortSettings.c_cflag |= CREAD | CLOCAL; SerialPortSettings.c_iflag &= ~(IXON | IXOFF | IXANY); SerialPortSettings.c_iflag &= ~(ICANON | ECHO | ECHOE | ISIG); SerialPortSettings.c_oflag &= ~OPOST;/*No Output Processing*/ /* Set the attributes to the termios structure*/ if((tcsetattr(fd,TCSANOW,&SerialPortSettings)) != 0) { perror ("\n ERROR! in set attrs"); return -1; } else printf("\n ttyUSB0 set to 19200-8N1\n"); bytes_written = str_send(fd,write_buffer); printf("\n Sending these 3 barcode:\n%s\n%s\n%s\n",item1,item2,item3); bytes_written += bc128_send(fd,item1); bytes_written += bc128_send(fd,item2); bytes_written += bc128_send(fd,item3); bytes_written += str_send(fd,msg2); printf("\n %d Bytes written to ttyUSB0", bytes_written); printf("\n +----------------------------------+\n\n"); close(fd);/* Close the Serial port */ } /* str_send : write string of bytes to the serial port */ /* specified by fd */ /* returns number of bytes written */ int str_send (int fd, char *msg) { return write(fd,msg,strlen(msg)); } /* bc128_send : send code128 barcode from string */ /* create code 128 barcode - Achtung! uses fixed length sequence */ /* with hardcoded length of 14 (0x0e) sent to printer */ /* which must be specified as a string even though it is only 1 byte */ /* or wrong data is sent down the line */ /* and the barcodes do not print */ int bc128_send (int fd, char *barcode) { int bcount = 0; bcount += write(fd,barcode128n,3); bcount += write(fd,"\x0e",1); bcount += write(fd,barcode,14); return bcount; }
printertest
]]>

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
https://ratcotel.net/?feed=rss2&p=401
0
Catcam https://ratcotel.net/?p=396 https://ratcotel.net/?p=396#respond Sat, 13 Aug 2016 18:49:35 +0000 http://ratcotel.net/?p=396 [...]]]> The CCTV at work was upgraded;  I got to recover the old DVR and have repurposed it alongside a cheap camera mounted at low level to watch cats and other creatures in my garden. It is better than normal British TV, like having your own personal nature channel 🙂

all creatures great and small :)

The statue of the Blessed Virgin Mary also reminds me to take care with the metal box as its a 230V to 12V psu where I mislaid the case screws, there is 230V mains on terminals inside it)

catcam monitor

This cat is the ringleader, but he shares the space with around 5 others and seems to even encourage them to visit my garden…

catcam

One bonus of this arrangement is if I see a cat I can sometimes then photograph it with a better camera (the kitties are often surprised that I seem to know where they are 🙂 )

moar kittehs

cats

Kätzin, interrupted....

Interestingly they seem to behave better since the CCTV was installed; they do not fight each other and make noise with miauwing at night nor foul this side of the garden.

It is not just cats either I see on the camera…

Hedgehog seen on the catcam!

Apologies for poor quality but that is a hedgehog. Apparently these are getting rare in some bits of England so I reported the sighting to Suffolk Wildlife Trust who put it on their map. A lot of folk seem to feed hedgehogs with cat food, I wonder if they are actually following the cats around (they are too big and well protected for lazy town cats to bother with them as prey)…

]]>

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
https://ratcotel.net/?feed=rss2&p=396
0
Long time no updates…. https://ratcotel.net/?p=392 https://ratcotel.net/?p=392#respond Sat, 13 Aug 2016 18:32:19 +0000 http://ratcotel.net/?p=392 [...]]]> There do seem to be folk who actually read this / stumble across the blog perhaps through searching for random tech stuff in spite of me rarely promoting it I thought I’d post an update and what I hope to do with this space..

Unfortunately last year I had to deal with a family bereavement as well as health problems/tiredness/burnout; often after I have finished with work-related tasks (which I try and prioritise my energy towards as I am lucky to have a very understanding and accomodating employer) I am way too tired for much else, such as music/creative stuff such as photography and tech/electronic projects.

Also slowly realising I am getting older and have had to make some different lifestyle choices; much less partying and late nights compared to my nearly two decades as a raver, DJ, party promoter etc. All good fun but starting to get a bit much in the end.

This has slightly reduced my enthusiasm for “harder” electronic music, so I have temporarily removed the online radiostation VFR Europe from here (as I hadn’t got the time to curate, upload and schedule content, let alone work on my home studio) although it will hopefully return in the future.

For those who want music there is still plenty on www.partyvibe.com

The good news is I am slowly regaining energy as well as getting into a better routine of sleep patterns, eating etc than in my “youth” (I still don’t consider myself to be old!) and there are still things I get up to I can blog about so hope to be posting here more often.

I don’t do “social networks” much – I (re)tweet occasionally at @vfrmedia (when I get round to it will add the twitter sidebar) and have no desire to become a “social media star” so this blog isn’t going to contain the latest “hip” technology; but will reflect my diverse tech/engineering interests (including “retro” stuff such as my reignited interest in fountain pens) as well as nature/and environment related content….

]]>

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
https://ratcotel.net/?feed=rss2&p=392
0
POCSAG pager transmitter using RF22 board and Arduino https://ratcotel.net/?p=376 https://ratcotel.net/?p=376#comments Sat, 06 Feb 2016 14:08:07 +0000 http://ratcotel.net/?p=376 [...]]]>

Since putting this project on Youtube I’ve had a surprising amount of interest from across the world about the modifications I made to the original code from ON1ARF ( a radioamateur in België) to allow 1200 and 2400 bps pager transmissions as well as the default 512bps (I wanted to use the circuit to test commercial POCSAG pager receivers used at one site at my work).

The original code is here

https://github.com/on1arf/pocsag

To get 1200 and 2400 bps you must alter the radiohead libraries it depends on.

Two files must change – the first is RH_RF22.cpp. The code snippet is below (cut and paste this into your editor)

header file for Arduino POCSAG RF22 tx

// These are indexed by the values of ModemConfigChoice // Canned modem configurations generated with // http://www.hoperf.com/upload/rf/RH_RF22B%2023B%2031B%2042B%2043B%20Register%20Settings_RevB1-v5.xls // Stored in flash (program) memory to save SRAM PROGMEM static const RH_RF22::ModemConfig MODEM_CONFIG_TABLE[] = { { 0x2b, 0x03, 0xf4, 0x20, 0x41, 0x89, 0x00, 0x36, 0x40, 0x0a, 0x1d, 0x80, 0x60, 0x10, 0x62, 0x2c, 0x00, 0x08 }, // Unmodulated carrier { 0x2b, 0x03, 0xf4, 0x20, 0x41, 0x89, 0x00, 0x36, 0x40, 0x0a, 0x1d, 0x80, 0x60, 0x10, 0x62, 0x2c, 0x33, 0x08 }, // FSK, PN9 random modulation, 2, 5 // All the following enable FIFO with reg 71 // 1c, 1f, 20, 21, 22, 23, 24, 25, 2c, 2d, 2e, 58, 69, 6e, 6f, 70, 71, 72 // FSK, No Manchester, Max Rb err <1%, Xtal Tol 20ppm { 0x2b, 0x03, 0xf4, 0x20, 0x41, 0x89, 0x00, 0x36, 0x40, 0x0a, 0x1d, 0x80, 0x60, 0x10, 0x62, 0x2c, 0x22, 0x08 }, // 2, 5 { 0x1b, 0x03, 0x41, 0x60, 0x27, 0x52, 0x00, 0x07, 0x40, 0x0a, 0x1e, 0x80, 0x60, 0x13, 0xa9, 0x2c, 0x22, 0x3a }, // 2.4, 36 { 0x1d, 0x03, 0xa1, 0x20, 0x4e, 0xa5, 0x00, 0x13, 0x40, 0x0a, 0x1e, 0x80, 0x60, 0x27, 0x52, 0x2c, 0x22, 0x48 }, // 4.8, 45 { 0x1e, 0x03, 0xd0, 0x00, 0x9d, 0x49, 0x00, 0x45, 0x40, 0x0a, 0x20, 0x80, 0x60, 0x4e, 0xa5, 0x2c, 0x22, 0x48 }, // 9.6, 45 { 0x2b, 0x03, 0x34, 0x02, 0x75, 0x25, 0x07, 0xff, 0x40, 0x0a, 0x1b, 0x80, 0x60, 0x9d, 0x49, 0x2c, 0x22, 0x0f }, // 19.2, 9.6 { 0x02, 0x03, 0x68, 0x01, 0x3a, 0x93, 0x04, 0xd5, 0x40, 0x0a, 0x1e, 0x80, 0x60, 0x09, 0xd5, 0x0c, 0x22, 0x1f }, // 38.4, 19.6 { 0x06, 0x03, 0x45, 0x01, 0xd7, 0xdc, 0x07, 0x6e, 0x40, 0x0a, 0x2d, 0x80, 0x60, 0x0e, 0xbf, 0x0c, 0x22, 0x2e }, // 57.6. 28.8 { 0x8a, 0x03, 0x60, 0x01, 0x55, 0x55, 0x02, 0xad, 0x40, 0x0a, 0x50, 0x80, 0x60, 0x20, 0x00, 0x0c, 0x22, 0xc8 }, // 125, 125 // { 0x2b, 0x03, 0xa1, 0xe0, 0x10, 0xc7, 0x00, 0x09, 0x40, 0x0a, 0x1d, 0x80, 0x60, 0x04, 0x32, 0x2c, 0x22, 0x04 }, // 512 baud, FSK, 2.5 Khz fd for POCSAG compatibility { 0x27, 0x03, 0xa1, 0xe0, 0x10, 0xc7, 0x00, 0x06, 0x40, 0x0a, 0x1d, 0x80, 0x60, 0x09, 0xd5, 0x2c, 0x22, 0x07 }, // 1200 baud, FSK, 4.5 Khz fd for POCSAG compatibility // { 0x27, 0x03, 0xa1, 0xe0, 0x10, 0xc7, 0x00, 0x06, 0x40, 0x0a, 0x1d, 0x80, 0x60, 0x04, 0x32, 0x2c, 0x22, 0x07 }, // 512 baud, FSK, 4.5 Khz fd for POCSAG compatibility // 2400 bps { 0x27, 0x03, 0xa1, 0xe0, 0x10, 0xc7, 0x00, 0x06, 0x40, 0x0a, 0x1d, 0x80, 0x60, 0x13, 0xa9, 0x2c, 0x22, 0x07 },// 2400 baud, FSK, 4.5 Khz fd for POCSAG compatibility // GFSK, No Manchester, Max Rb err <1%, Xtal Tol 20ppm // These differ from FSK only in register 71, for the modulation type { 0x2b, 0x03, 0xf4, 0x20, 0x41, 0x89, 0x00, 0x36, 0x40, 0x0a, 0x1d, 0x80, 0x60, 0x10, 0x62, 0x2c, 0x23, 0x08 }, // 2, 5 { 0x1b, 0x03, 0x41, 0x60, 0x27, 0x52, 0x00, 0x07, 0x40, 0x0a, 0x1e, 0x80, 0x60, 0x13, 0xa9, 0x2c, 0x23, 0x3a }, // 2.4, 36 { 0x1d, 0x03, 0xa1, 0x20, 0x4e, 0xa5, 0x00, 0x13, 0x40, 0x0a, 0x1e, 0x80, 0x60, 0x27, 0x52, 0x2c, 0x23, 0x48 }, // 4.8, 45 { 0x1e, 0x03, 0xd0, 0x00, 0x9d, 0x49, 0x00, 0x45, 0x40, 0x0a, 0x20, 0x80, 0x60, 0x4e, 0xa5, 0x2c, 0x23, 0x48 }, // 9.6, 45 { 0x2b, 0x03, 0x34, 0x02, 0x75, 0x25, 0x07, 0xff, 0x40, 0x0a, 0x1b, 0x80, 0x60, 0x9d, 0x49, 0x2c, 0x23, 0x0f }, // 19.2, 9.6 { 0x02, 0x03, 0x68, 0x01, 0x3a, 0x93, 0x04, 0xd5, 0x40, 0x0a, 0x1e, 0x80, 0x60, 0x09, 0xd5, 0x0c, 0x23, 0x1f }, // 38.4, 19.6 { 0x06, 0x03, 0x45, 0x01, 0xd7, 0xdc, 0x07, 0x6e, 0x40, 0x0a, 0x2d, 0x80, 0x60, 0x0e, 0xbf, 0x0c, 0x23, 0x2e }, // 57.6. 28.8 { 0x8a, 0x03, 0x60, 0x01, 0x55, 0x55, 0x02, 0xad, 0x40, 0x0a, 0x50, 0x80, 0x60, 0x20, 0x00, 0x0c, 0x23, 0xc8 }, // 125, 125 // OOK, No Manchester, Max Rb err <1%, Xtal Tol 20ppm { 0x51, 0x03, 0x68, 0x00, 0x3a, 0x93, 0x01, 0x3d, 0x2c, 0x11, 0x28, 0x80, 0x60, 0x09, 0xd5, 0x2c, 0x21, 0x08 }, // 1.2, 75 { 0xc8, 0x03, 0x39, 0x20, 0x68, 0xdc, 0x00, 0x6b, 0x2a, 0x08, 0x2a, 0x80, 0x60, 0x13, 0xa9, 0x2c, 0x21, 0x08 }, // 2.4, 335 { 0xc8, 0x03, 0x9c, 0x00, 0xd1, 0xb7, 0x00, 0xd4, 0x29, 0x04, 0x29, 0x80, 0x60, 0x27, 0x52, 0x2c, 0x21, 0x08 }, // 4.8, 335 { 0xb8, 0x03, 0x9c, 0x00, 0xd1, 0xb7, 0x00, 0xd4, 0x28, 0x82, 0x29, 0x80, 0x60, 0x4e, 0xa5, 0x2c, 0x21, 0x08 }, // 9.6, 335 { 0xa8, 0x03, 0x9c, 0x00, 0xd1, 0xb7, 0x00, 0xd4, 0x28, 0x41, 0x29, 0x80, 0x60, 0x9d, 0x49, 0x2c, 0x21, 0x08 }, // 19.2, 335 { 0x98, 0x03, 0x9c, 0x00, 0xd1, 0xb7, 0x00, 0xd4, 0x28, 0x20, 0x29, 0x80, 0x60, 0x09, 0xd5, 0x0c, 0x21, 0x08 }, // 38.4, 335 { 0x98, 0x03, 0x96, 0x00, 0xda, 0x74, 0x00, 0xdc, 0x28, 0x1f, 0x29, 0x80, 0x60, 0x0a, 0x3d, 0x0c, 0x21, 0x08 }, // 40, 335 };
RH_RF22.cpp

Also the header file RH_RF22.h must change so the modemconfig table has values that reflect the changed modulation schemes.

RF22 headerfile

typedef enum { UnmodulatedCarrier = 0, ///< Unmodulated carrier for testing FSK_PN9_Rb2Fd5, ///< FSK, No Manchester, Rb = 2kbs, Fd = 5kHz, PN9 random modulation for testing FSK_Rb2Fd5, ///< FSK, No Manchester, Rb = 2kbs, Fd = 5kHz FSK_Rb2_4Fd36, ///< FSK, No Manchester, Rb = 2.4kbs, Fd = 36kHz FSK_Rb4_8Fd45, ///< FSK, No Manchester, Rb = 4.8kbs, Fd = 45kHz FSK_Rb9_6Fd45, ///< FSK, No Manchester, Rb = 9.6kbs, Fd = 45kHz FSK_Rb19_2Fd9_6, ///< FSK, No Manchester, Rb = 19.2kbs, Fd = 9.6kHz FSK_Rb38_4Fd19_6, ///< FSK, No Manchester, Rb = 38.4kbs, Fd = 19.6kHz FSK_Rb57_6Fd28_8, ///< FSK, No Manchester, Rb = 57.6kbs, Fd = 28.8kHz FSK_Rb125Fd125, ///< FSK, No Manchester, Rb = 125kbs, Fd = 125kHz FSK_Rb_1200Fd4_5, ///< FSK, No Manchester, Rb = 1200bs, Fd = 4.5kHz, for POCSAG compatibility // FSK_Rb_512Fd4_5, ///< FSK, No Manchester, Rb = 512bs, Fd = 4.5kHz, for POCSAG compatibility FSK_Rb_2400Fd4_5, ///< FSK, No Manchester, Rb = 2400bs, Fd = 4.5kHz, for POCSAG compatibility GFSK_Rb2Fd5, ///< GFSK, No Manchester, Rb = 2kbs, Fd = 5kHz GFSK_Rb2_4Fd36, ///< GFSK, No Manchester, Rb = 2.4kbs, Fd = 36kHz GFSK_Rb4_8Fd45, ///< GFSK, No Manchester, Rb = 4.8kbs, Fd = 45kHz GFSK_Rb9_6Fd45, ///< GFSK, No Manchester, Rb = 9.6kbs, Fd = 45kHz GFSK_Rb19_2Fd9_6, ///< GFSK, No Manchester, Rb = 19.2kbs, Fd = 9.6kHz GFSK_Rb38_4Fd19_6, ///< GFSK, No Manchester, Rb = 38.4kbs, Fd = 19.6kHz GFSK_Rb57_6Fd28_8, ///< GFSK, No Manchester, Rb = 57.6kbs, Fd = 28.8kHz GFSK_Rb125Fd125, ///< GFSK, No Manchester, Rb = 125kbs, Fd = 125kHz OOK_Rb1_2Bw75, ///< OOK, No Manchester, Rb = 1.2kbs, Rx Bandwidth = 75kHz OOK_Rb2_4Bw335, ///< OOK, No Manchester, Rb = 2.4kbs, Rx Bandwidth = 335kHz OOK_Rb4_8Bw335, ///< OOK, No Manchester, Rb = 4.8kbs, Rx Bandwidth = 335kHz OOK_Rb9_6Bw335, ///< OOK, No Manchester, Rb = 9.6kbs, Rx Bandwidth = 335kHz OOK_Rb19_2Bw335, ///< OOK, No Manchester, Rb = 19.2kbs, Rx Bandwidth = 335kHz OOK_Rb38_4Bw335, ///< OOK, No Manchester, Rb = 38.4kbs, Rx Bandwidth = 335kHz OOK_Rb40Bw335 ///< OOK, No Manchester, Rb = 40kbs, Rx Bandwidth = 335kHz } ModemConfigChoice;
RH_RF22.h

the rest can then be used as normal – remember to alter the main Arduino sketch code to select these new bps rates.

NB: I am based in the UK/Europe; we always use wide deviation for POCSAG signals (although much other PMR traffic is now on narrow deviation).

If your country’s Communications Ministry requires narrow deviation to be used you will have to recalculate the modem settings using the spreadsheet referred to in the library files. (Its not as bad as it might seem; I had to use it to get the 1200/2400bps settings and I am not an RF nor a coding expert by any means)

 

]]>

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
https://ratcotel.net/?feed=rss2&p=376
6
soundprocessing on 100V PA amplifier /.LS system https://ratcotel.net/?p=366 https://ratcotel.net/?p=366#respond Mon, 07 Sep 2015 13:32:54 +0000 http://ratcotel.net/?p=366
Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
I used the Japanese Multimax program + two obsolete XP PC’s. The PC also has a second soundcard connected to Ekiga on auto answer so dialling extension 338 will allow announcements to be made on the PA amp (it is connected to an input with auto vox volume ducking).

 

]]>

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
https://ratcotel.net/?feed=rss2&p=366
0
Chinese PABX instructions https://ratcotel.net/?p=359 https://ratcotel.net/?p=359#respond Wed, 19 Aug 2015 10:42:44 +0000 http://ratcotel.net/?p=359 This PABX is now sold as an improved version with a better translated manual; but (as I have some Chinese ancestry on my fathers side) I prefer the “Chinglish” version 😀

 

Chinese PABX manual - transferring callsChinese PABX manual - ring trip relayChinese PABX manualChinese PABX manualChinese PABX manual - health and safety ;)

Chinese PABX manual - ninja powers

]]>

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
https://ratcotel.net/?feed=rss2&p=359
0
and some ARM assembler…. https://ratcotel.net/?p=353 https://ratcotel.net/?p=353#respond Sat, 08 Aug 2015 15:11:30 +0000 http://ratcotel.net/?p=353 [...]]]> gcc can compile either c source or assembler (.s extension) or even a combination of both.

As I had the assembler source, decided to experiment with altering the string data (I don’t yet know enough to do anything else).

ARM asm source with some slight alterations

it still worked 🙂

asm source output

note how the addresses of the array pointer change, as the strings have grown by a few characters…

below is the original code

WP_20150807_19_14_07_Rich

of course this is basic easy stuff; those strings are static/constant data and declared at compile time. if your code is dealing with strings that can change their length, it must always have sufficient free memory allocated to wherever the string data ends up, enough for the largest of the data. Otherwise you get a buffer overflow and your goose is cooked…

]]>

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/42/d24067567/htdocs/clickandbuilds/WordPress/rtn_vfrmedia_newblog/wp-includes/formatting.php on line 4798
https://ratcotel.net/?feed=rss2&p=353
0