Securing your node-red editor and dashboard on the Raspberry Pi

If you leave your node-red installation on your rpi running without a password you will be hacked and soon owned by people using your rpi as a bit coin mining device. It is easy to set a password for the editor and for the dashboard!:

Node-red is installed in /home/pi/.node-red (the . dot in front means you will normally not be able to see the directory as the dot means it is hidden. Therefore, set up your file manager to show hidden files. Alternatively, if you are using the terminal you can use ls -a or ls -al in the /home/pi directory to see all that is there).

Edit the settings.js file with

nano settings.js

Uncomment this section in the settings.js file:

adminAuth: {
type: "credentials",
users: [{
username: "admin",
password:"xxxhash key is pasted herexxxx",
permissions: "*"
}]
},

You will need to generate a hash with node-red-admin and type the hash-pw command. The hash key you paste above in the field xxxhash key is pasted herexxxx (keep the ” ” signs and dont mess up the [ ] {} , stuff).

You will probably have to install the node-red-admin tools (google how to do that with npm) to be able to use node-red-admin

For the dashboard you do the same procedure but you now un-comment this line

httpNodeAuth: {user:"user",pass:"xxxxdashboard hash key is pasted herexxxx"},

Make sure to keep all commas etc!
If you are uncertain to what directory your rpi reads the settings.js file from, you can start the node-red with node-red-pi and look at the messages in the console. It will report the location and file it uses. Dont edit the wrong settings.js file … there are several installed on your pi it seems

Restart the node red
IMPORTANT! CLEAR THE CACHE of your web browser. If not you will not see the password on the editor and the dashboard, as node-red uses cache quite heavily. See https://support.mozilla.org/en-US/kb/how-clear-firefox-cache for how to clear Firefox cache

Telenor 4G modem, IP camera, remote radio, remote SDR setup (Norwegian language)

Hvis du vil sette opp et 4G IP kamera, en 4G alarm, eller kjøre amatørradio via 4G remote så må du sette opp 4G ruteren din slik at datatrafikk UTENFRA kan komme inn igjennom 4G ruteren. For å kunne få dette til å virke må du kjenne IP adressen til 4G ruteren din. Ringer du Telenor support får du som regel et “god dag mann økseskaft svar”. Ringer du “telenor eksperten”, så får du ofte et nytt “goddag mann økseskaft svar”, men denne  gangen må du betale for det! Denne quick guiden omhandler Telenor D-link DWR-961 ruter.

Utfordring 1: Telenor har satt opp sine 4G rutere per default slik at du ikke har en egen IP adresse som er synlig på internett. Datatraffikk utenfra blir også stoppet (av sikkerhetsgrunner – som regel har ikke vanlige brukere behov for at traffikk utenfra skal kunne komme igjennom om den ikke er initiert innenfra først).

Løsning:

  • Logg inn på ruteren via kabel i LAN1, LAN2, LAN3 eller LAN4 porten (ikke WAN porten). Du har innloggingsdetaljene fra Telenor (ikke sant?)
  • Gå til “internett fanen”
  • Endre APN(Access Point Name) til internet.public  (med små bokstaver)
  • Restart ruteren
  • Nå har du en IP adresse som både er synlig utenfra og traffikk kan nå inn til ruteren din

Utfordring 2: IP adressen er ikke fast så den endrer seg hele tiden. Du aner ikke hvilken ip adresse 4G modemet ditt og det utstyret som står tilkoplet på innsiden har…. hvordan skal du da kunne aksessere dette?

Løsning:

  • Sett opp en dynamisk DNS
  • Viktig: Kun Dyndns (heter nå dyn.com) fungerer. Ingen av de andre dynamisk DNS tilbyderne fungerer.
  • Viktig: du  må nå betale for dyndns servicen fra dyn.com (ca 500 kr per år). Dette er det ingen vei utenom (som jeg har funnet i alle fall). Dyndns free service er discontinued så nå må du betale for tjenesten.
  • Gå hit https://dyn.com/dns/dyndns-pro-free-trial/ og registrer en gratis konto
  • Velg et passende sub-domenenavn  som f.eks pettersipkamera1.dyndns.org (fyll inn ditt valgte navn). Sub domenet er det som stør før første prikk, selv om det virker litt lite intuitivt at det står før prikken og ikke etter. Domenet er det som står etter prikken, men dette er jo forhåndsbestemt til å være dyndns.org
  • Gå til Advanced og DynDNS i oppsettsmenyene i Telenor 4G ruteren din (via web browser)
  • Fyll inn brukernavn, passord og hostname. Hostname er det du satt opp over når du registrerte kontoen hos dyn.com. For eksempel pettersipkamera1.dyndns.org 
    (selv om dyndns nå heter dyn.com så er dyndns.org fortsatt live and kicking)
  • Husk å klikke på DDNS så dynamisk DNS er skrudd på i ruterens meny
  • Nå vil pettersipkamera1.dyndns.org peke til IP adressen til ruteren din (SELV OM TELENOR SINE SYSTEMER ENDRER IP ADRESSE på 4G RUTERE INNIMELLOM!)
  • Så må du sette opp port forwarding, om du bruker egne porter. Dette gjøres i fanen Advanced / Port Forwarding. Du må vite den interne adressen til IP kameraet ditt. F.eks 192.168.0.123
  • Du må vite hvilken port IP kameraet ditt bruker
  • Så setter du opp hvilken port INN til 4G ruteren som skal forwardes til hvilken IP adresse (f.eks 192.168.0.123) og port inne på det lokale nettverket ditt
  • Lagre og gjør en reboot / omstart av ruteren
  • Og VIPPS, du ser og kan overvåke din eiendom / hytte / whatever på IP kameraet og er i høyeste beredskap til en hver tid! Alarmsystemer, sensorer, styringer osv kan koples til på denne måten.
  • (Om du er radioamatør, så ser du radiosystemet ditt og er klar til å kjøre remote radio).

Håper dette var til hjelp. Ønsker du hjelp til en kommersiell installasjon, IoT eller liknende så kjenner jeg firmaer som kan hjelpe med dette. I så fall ta kontakt så kan jeg formidle info.

FT-891 and TRX-manager CAT control software

I have successfully got FT891 running under TRX-manager: http://www.trx-manager.com/index.html

1) Install the dual serial port driver from Yaesu website. 
See manual here: http://www.yaesu.com/airband/downloadFile.cfm?FileID=9515&FileCatID=42&FileName=USB%5FDriver%5FInstallation%5FManual%5FENG%5F1610%2DB0.pdf&FileContentType=application%2Fpdf

(Note: the 891 has dual serial ports, it does not have an USB soundcard).

2) Reboot the PC and check that you see two serial devices in your Device manager (type device manager when clicking the start button)

3) Hold F on the FT-891 in a couple of seconds (long click)

4) Goto menu 05-06
Set CAT RATE to 38400

6) Goto menu 05-08.
 Set CAT RTS to DISABLE (unless you do that you may have a problem getting data thru)

7) Set the rate to 38400 in TRX-manager (setup menu) and select FT-891. Also select correct COM port (on my PC it was COM5. It may be different on yours).
Remember: unless you set CAT RTS to DISABLE (see above) you will not get data thru and you will mess around in the TRX-manager menus while the problem was a setting in the FT-891 menu.

8) Stop and restart TRX-manager

9) You may hear a clicking sound for every CAT transmission in your FT-891 loudspeaker (A bit annoying… I have to admit that even if I like Yaesu radios)

10) Click F on the FT-891 (short click)

11) Goto MON on the FT-891 menu

12) Click on MON

13) Turn down the MON level to 0
Note: This applies regardless if you have MON ON or MON OFF (this is a bug in Yaesu’s firmware. Rare. LOL)

14) Now you have CAT control without any clicking sounds on your FT-891

15) Enjoy your Yaesu FT-891

Comments about the FT-891: 

Plusses: the FT-891 has in my view a better and more modern RX than the ageing FT-857, even better than IC7300 (some ppl. claim) http://www.eham.net/reviews/detail/13042?page=2 , it is a low cost modern mobile 100W HF rig with a small detachable front, it has DSP RX, a nice variable RX filter, works well down to low voltages even if someone claims it doesn’t, has a much better menu system and a better VFO, it has a reasonable current draw on RX (even if the datasheet overstates this a bit it is below 1A on my rig).

Minuses: No VHF or UHF ( however that may be a benefit. Not the compromises that probably are in the 857 rf chain). No USB soundcard (do you really need that in a mobile station?), 60M USB has to be programmed in a memory and you go memory tune from there and it will keep USB even if you are below 10 MHZ.

How to do export and import of Excel files with CSV firmat in Chirp

  • Program a couple of memory channels in your radio (in my case Icom Ic-2725) from the RADIO menus
  • Connect chirp to the radio
  • DOWNLOAD the data from the radio
  • Export from Chirp to a CSV file
  • Study this CSV file and use it as a template
  • Copy paste frequency and ctcss and offset info ++ from ANOTHER XLS file to the CSV file you made above!
  • Save as CSV from Excel (this is now your frequency list to import to the radio)
  • Check with Notepad ++ that there is COMMA (not semicolon) separation saved when you save as CSV from Excel. If this is not the case, go to regional settings / additional and set list separator as , (as opposed to ;). Start and stop Exel and a reboot wont hurt to make the settings take effect
  • Now you import this CSV list into Chirp
  • Upload to the radio
  • If you get error message that Chirp cant convert floating point in the tone settings, make sure to format EVERYTHING in your Excel sheet as GENERAL (not text, not number)

 

CAT / RS232 / CW interface (FTDI, MAX232, 5V controllable FETs)

I made a CAT and CW interface from readily available components. Of course it is possible to buy a microham interface or simular. However, I wanted no USB soundcard functionality and Xp, Win 10, Linux compatibility without having to install drivers. A native FTDI chip from SF will do the job nicely. The FTDI chip has 5V TTL out and the true RS232 has +-1 12V signal levels. Therefore I pressed a MAX232 board that I designed approx 10 years ago and was laying in the junkobox into service. 5V TTL into and out from the MAX232 chip into the FTDI chip.
I used some “5V TTL FETs” for switching the CW signal. The RTS / CTS signals from the FTDI interface can drive these fets directly. I needed to invert the signal so that the CW keying is off by default. So since I had two of the 5V TTL FETs laying in the junkbox, I used one to invert and one to drive the CW key output. On the picture to the left the fets can be seen.
Here the quick and dirty prototype can be seen. The old RS232 converter board to the left, the switching FETs to the right and the FTDI board below.

HDSDR trackerball VFO project

I have been working on a trackball based controller for my HDSDR SDR project lately. This is a small R&D project that is run on my spare time where the goal is to determine if it is possible to use a trackball as a VFO for software defined radio (SDR) in contests. The project started out based on a demand for a more ergonomic way to operate a mult receiver in a contest environment that is less fatiguing during 48hours duration of a major contest like CQWW or CQWPX. The goal is that it should be possible to operate all radio functions you need from one hand only: VFO, speed of vfo, band, mode, filter width, volume, gain. I have modified a Marconi trackball and the controller is a Trinket Pro controller (Arduino)

20151219_131116 20151219_130846 20151219_123341 20151219_163343
20151217_211347 20151217_211710

20151219_153628

 

RF current amperemeter with log detector

I have long had the need to measure antenna current. This can be done by a rf-current transformer and a rectifier made by a shottky diode or fast silicon diode and an integrator driving a mechanical instrument. However the dynamic range is very limited with such a setup.

Therefore I made a new rf-amperemeter design with a log detector chip from Analog Devices driven from a current transformer made out of a split core ferrite material that has response in the HF and lower VHF frequency range.The current trafo is terminated in a few ohms and the RF current conductor (actually the primary) sees only a fraction of an ohm so very little influence is done on the circuit you are measuring. (Apart from capacitive coupling and a slight leakage inductance from the current transformer windings/ferrite combination). The ferrite core is a split type and is epoxied to a clip.

I calibrated the instrument by terminating the generator in a fancooled 100W dummy load and measured the voltage over the load by an oscilloscope. Since it has a log output the dynamic range from milliamp range up to 1,4A RF current. That would peg a mechanical instrument if you would at the same time want to be able to detect a significantly lower RF-current without having to change scales with switches / pot meters etc.

Next I plan on making a OLED display on this design with an arduino controller. Its a sparetime project so lets see how long tiem it takes before I implement that.

20151028_171941 20151028_171934 20151028_123754 20151028_123344 20151028_123330 20151028_111539 20151028_111534 20151027_222849 20151027_222832 20151027_222828 20151027_222353 20151027_222327 20151027_193055 20151027_151301 20151027_151250 20151027_123354 20151027_123343 20151027_123332 20151027_112816 20151027_112802 20151027_112746