Archive for the Electronics Category

KKMoon P2P PTZ cam tips

Posted in Electronics on 15 May 2016 by iw0ffk


A new pan & tilt camera installed on the rooftop to monitor the antennas, it’s a chinese 720p “KKMoon P2P Cam”, hardware version = JH41E-V1.0, firmware version build 2015.06.09 02:51.
I bought it on Ebay and received a partial refund due the several bugs in the firmware which make the object to be used with caution and a number of declared functions does not work at all:

  • Sending email notification when a motion is detected does not work, at least with my SMTP servers.
  • FTP upload of the images does not work. I’ve tried with my local working server, no success.
  • There is not a plugin for Firefox or Chrome, the only browser capable to view the h264 streaming video is MS Internet Explorer with a proprietary plugin. The stream can be reproduced also by VLC but without the pan and tilt controls.
  • There is a security issue, the rtsp stream can be opened without inserting any password even if the password is correctly set.

On the other hand the Android app works quite well and the image have a good quality.
Googling around I’ve found few results about this cam, this one is the most interesting.

Summing up, to view the stream with VLC (without password) the address to open is


To catch a snapshot the http address is


Unfortunately the snapshot image has a very low resolution 320×240.
I like to save an image every some minutes to create a time-lapse video, this resolution is unacceptable, but there is a workaround to obtain snapshots with good quality. This command get some seconds of video then save an image with native resolution 1280×720

cvlc rtsp://user:pass@IPAddress/camera-media/profile0 –video-filter=scene –scene-prefix=$prefix –scene-format=jpg –scene-path=./ –scene-ratio 240 –sout-x264-lookahead=10 –sout-x264-tune=stillimage –vout=dummy –run-time 15 vlc://quit

To rotate the camera the sniffed commands are

Move to the preset x:
where x = 1 to 16, preset number

Move UP:
Move DOWN:
Move LEFT:
Stop Movement:

I prepared a simple Python script to be executed in a terminal ->

$ ptz 3 moves the cam to the preset number 3
$ ptz r 2 moves the cam to the right for 2 seconds




Playing with ESP8266

Posted in Electronics on 1 May 2016 by iw0ffk

I am always been interested in efficient ways to remote control via internet my hamradio station, mainly due to the fact that I’m away from the shack most of the time.
I use my fully controlled remote station since 2006, my first QSO from the workplace was YL2HA in 144MHz during a good E-sporadic opening on 13/06/2006. Over the years several improvements have been added to reduce the bandwidth, the delay of the link and, in the latest years, to be QRV and work some basic QSOs by using the smartphone.

Some months ago I heard about a wifi module that can be controlled via AT commands (like the old modems) and I immediately bought one for few euros. The plan was to give a TCP way to communicate with the world to all the microcontrollers without the need to fill them with the TCP-IP stack.


When I received the module, based on the ESP8266 v12E, I discovered that it can be flashed  with a different firmware that permits to use the onboard microcontroller to control some input/output ports and a 10bit ADC. So there is no need to add another microcontroller to send the AT commands.

The new firmware is called Nodemcu and, when flashed, removes the AT commands  and adds a Lua interpreter. Lua is a programming language used for generic scripting.
I wrote a simple script to connect my access-point and start a basic web-server to control the status of an output pin, this pin drives a relay that switches on-off a 220V socket.
When connected to the access point, a led blinks in Morse code the last number of the ip address, to easily identify the module in a DHCP network.

This “Wifi controlled 220V socket” was built in few hours, I will use it to switch on the power amplifier when needed (instead to leave it always powered on).

I think the ESP8266 can have in the future many interesting applications to the our hobby.
I already have some ideas about it and I ordered a good number of these modules :-)

Repairing the Kenwood TS-590 USB port after a surge

Posted in Electronics with tags , , , on 27 April 2016 by iw0ffk

Some years ago a lightning surge entered from the antenna’s rotator to the control box then to the personal computer’s usb hub and has broken all the peripherals connected: keyboard, mouse, webcam, all the usb ports of the PC and the port of the Kenwood TS-590 :-|

Fortunately (…) the transceiver was still usable because the USB features are redundant:  it’s possible to use the analog audio in/out on the ACC connector and the DB9 RS232 port to control the rig.

After a quick check the result was the fuse F901 blown, the USB Hub IC905 shorted to GND and the zener protection D901 destroyed. I’ve closed the transceiver and used it without USB for several months.


Now I’m improving my home station for remote use and I want to substitute the TS-2000 with the TS-590 expecially for 6m band, it has a noise filter much more efficient respect to the TS-2000 and the city noise here is growing up quickly!

So I’ve bought the replacement parts to restore the original functionality.
The work isn’t easy! The USB hub has 36pins in a footprint 4 x 7mm and it has around a good number of very tiny resistors capacitors etc.
To remove the component I used an hot air station by AOUYE and a preheater of the same producer, they are not professional tools, but can do the job.

After replacing the IC and the fuse I powered up the transceiver, connected the USB port but no new peripherals have been detected by the OS :-(

Further analysis showed that there was still a problem on the supply, result is two other tiny ICs to replace: the power switch Q902 just after the fuse and the AND port IC904. With a wire jumper both the switches are now bypassed and the peripherals (hub+codec+232 converter) finally appear in my USB list :-)


Now I’m looking for these parts to complete the work:
Q902 – HN7G01FU-F (Mouser code 757-HN7G01FU-AT5L,FT )
IC904 – TC7SH08FU-F (RS code 540-6863)

If anyone has the same problem with the TS590’s USB port, I will be happy to exchange the USB2512 and the protection zener RSB12JS2 with these components…I have them abundantly…RS sells minimum 5 parts and now I have 4 unused.

Powermaster, how to read data via RS232

Posted in Electronics, VHF on 2 June 2015 by iw0ffk


The “Power Master” is a digital RF power meter produced by Array Solutions. The coupler is separated from the display, useful when the amplifiers are away from the shack.

It has a RS-232 DB9 plug and can be connected to a serial port of the personal computer to read the FWD/REV Power and SWR with his control panel software called “Power Master Basic”.

Unfortunately this software runs only in Windows, if one needs to read the data in Linux or OSX (or in Windows with custom software) the Power Master’s RS232 port has to be activated, then the power can be easily read, parsing the ascii string coming out from the wattmeter.

To enable reading via the serial port, the undocumented command is:

0x02 0x44 0x31 0x03 0x43 0x30 0x0d 0x53 0x00

Total 9 bytes, the numeric notation 0xNN indicates an 8-bit value expressed using hexadecimal format.

When this command is received, the Power Master starts to send the data (example for 128W forward power and 1.11 SWR) :

(0x02)D,128,0, 1.11,0;0;0;0;0(0x03)4C

Hope this helps.

This morning good opening on 50MHz with East, heard some JA stations and worked a new country: Malaysia.


9M2TO in OJ05 #194

Tighten RF connectors to the required torque (without the appropriate wrench)

Posted in Electronics on 16 December 2014 by iw0ffk

Some RF connectors must be tightened with a torque wrench to the correct value specified by the manufacturer.

Often the wrench is too expensive for occasional and amateur use, but we can still *approach* the correct torque easily and with minimal cost.

Example with SMA connectors.

All we need is a wrench and a digital luggage scale.


The SMA connectors must be tightened with a torque between 0.8 and 1.1 N.m with a 5/16″ (about 8 mm) wrench, the scale can be bought on Ebay, Amazon etc.

The length of the wrench, at the centre of the nut, must be measured. This one is 110mm.


When the scale reading is 1 kg, the force applied is 9.81 N.
The mean datasheet torque value for this connector is 0.9 N.m, namely a force of 0.9N must be applied with a wrench 1m long.

With my 0.11 m wrench, the force to be applied is 0.9 / 0.11 = 8.18 N. The scale measure for 8.18 N  is 8.18/9.81 = 0.83 Kg

This force should be applied *momentarily*, as soon as you read 0.83 Kg on the scale, the connector is tightened well and the force must be removed immediately.

The torque should be measured with the wrench in vertical position, to minimize the effect of his weight.


My Begali morse key misses some dash

Posted in Electronics on 8 December 2014 by iw0ffk

Recently my Begali “Simplex” key starts to miss some dash during transmission, very annoying. I cleaned the moving contacts with isopropyl and triple checked wires and solders, everything ok but the problem was still present.


The bad point was hidden inside the turret that holds the ball contact with the mobile lever.

I removed the contact and the spring and it’s evident the corrosion on the bolt



Maybe the different metal in contact favors the corrosion of this bolt.

Cleaned the dust gently with a small brush and applied a thin layer of vaseline grease.

Now it’s back on air

Useful cardboard rulers

Posted in Electronics on 11 November 2014 by iw0ffk

I really like smart rulers.

Slide or fixed, circular or rectangular they are all useful gadgets and have a place in my lab.

I’ve found a new one for my collection at the last European Microwave Week 2014 at the Rohde & Schwarz stand.

No pretty frills, it converts at a glance Watts to dBm and to Volt (Z=50 Ohm) and calculate a ratio, voltage or power, in dB


Another useful ruler is made by TK5EP with the great software Galva by F5BU

It’s a circular SWR/Return Loss/ Gain  calculator. Aligning the forward power on the external disk with the reflected power on the internal disk, we can see the SWR and the RL through the little window.


The file to print and cut out is on TK5EP’s website.

Following this link you reach  the Museum of Rulers with many scales.