Remote Ham Radio via WebRTC Audio / Raspberry Pi 3

The Experiment: In this experiment we are re-visiting the possibility to stream Transceiver Audio to and from the remote station though a Browser using WebRTC.  WebRTC has improved since the last time I tried it, latency/audio quality have much improved. To accessing the WebRTC Remote Rig server, Just launch a WebRTC/JavaScript compatible browser (e.g. chrome/firefox/opera on desktop/android).


Table of Contents
1. Progress
2. Software Packages
3. Directory Structure
4. Hardware
5. Notes
6. Conclusion
7. Reference Links

Other Ham Radio Remote Experiments on this site
1. Remote Ham Radio WebRTC Audio via a Raspberry Pi <- You are here
2. Remote Ham Radio HTML5 Audio via a Raspberry Pi
3. Raspberry Pi Ham Radio Remote Base via Web Audio API
4. Remote Ham Radio Control via Yaesu PCC / Raspberry Pi
5. Remote Ham Radio Yaesu PCC Software Parole Audio via a Raspberry Pi
6. Remote Hame Radio JAVA Audio a Complete Solution via a Raspberry Pi


Progress

Quickest build yet three week.

The Rev 0.0.0.1 Raspberry Pi Ham Radio WebRTC Remote Rig.
Features:
1. None – For IC-7300 all you need is USB cable and WebRTC signaling / CAT server.

The Audio / CIV Interface:

Using the ICOM IC-7300 & a Raspberry Pi there is no external Audio interface,   Audio  / CAT Control all though the IC-7300 USB port.

So here we have a  Browser screen shot IC-7300 WebRTC Remote Rig on Android Phone.

and Browser screen shot IC-7300 WebRTC Remote Rig on PC Desktop.

and Browser screen shot WebRTC Remote Rig displaying  One-Way Video.

Note: For better Video contrast lower the IC-7300 screen brightness.

^Top


Software: Raspberry Pi 3 Model B/B+

  1. 2018-10-09-raspbian-stretch-lite
  2. Node.js V-7.2.0
  3. NPM V-3.10.9
  4. Xvfb
  5. Chromium 72.0.3626.121 Built on Raspbian , running on Raspbian 9.9
  6. webrtc-remote-rig

Recently Tested works Fine:

  1. 2019-09-26-raspbian-buster-lite
  2. Chromium 74.0.3729.157 Built on Raspbian , running on Raspbian 10

Recently Tested But No-longer Working:

  1. 2019-09-26-raspbian-buster-lite
  2. Chromium 78.0.3904.108 Built on Raspbian , running on Raspbian 10

Note:  Chromium 78.0.3904.108 in 2019-09-26-raspbian-buster-lite no longer works. So  I have gone back to using 2019-04-08-raspbian-stretch-lite with Chromium 72.0.3626.121 Built on Raspbian , running on Raspbian 9.9.

There is always a WebRTC problem when Google releases a new version of Chromium-browser. Most of the problems are security related using a Self-signed Certificate with Chromium 78.0.3904.108 no longer works, some of the flag to make it work no longer work. Chromium 77.0.3865.116 worked fine in 2019-09-26-raspbian-buster-lite but Chromium 78.0.3904.108 does not.

When using a real https Certificate everything works fine but paying for a real Certificate and a domain name is just to expensive for just playing with WebRTC.

Please Note:  There is nothing wrong with the 2019-09-26-raspbian-buster-lite image the problem is Chromium 78.0.3904.108 browser which no longer give access to the Camera – Microphone with a Self-signed Certificate.

2/12/2020: Got Chromium 78.0.3904.108 browser working with self-signed cert with 2019-09-26-raspbian-buster but find performance on 2018-10-09-raspbian-stretch much better.

2/16/2020: Tested 2020-02-05-raspbian-buster with chromium-browser 78.0.3904.108, finally  WebRTC Remote Rig app running  good on Raspberry Pi desktop. Also  new features Dial now will auto change frequency on mouse-down or touch-start, on-click will change frequency one step at a time, Refresh now has refreshing reloading spinner and the RX-TX indicator now blinks when out off band. Chromium-browser 78.0.3904.108 is giving a Uncaught TypeError and Uncaught (in promise) DOMException all still working not sure why that’s happening but that’s all part of experimenting with WeRTC some new problem on every update.

5/18/2020: No WebRTC Speaker Audio,  Microphone OK 2020-02-05-raspbian-buster. The problem no WebRTC audio but able to play YouTube just fine. WebRTC found Media requested access to the Microphone and started a session without Speaker audio on the Rapberry Pi.  I verified that the right Audio card was selected but still no Speaker audio. So installed a new image on SD card booted the Raspberry Pi set: dtparam=audio=off commented: #options snd-usb-audio index=-2  re-booted the Raspberry Pi selected USB Audio card and still no WebRTC Speaker audio. Spent a hole day on this finale found the problem in the .asoudrc

pcm.!default {
	type asym
	playback.pcm {
		type plug
		slave.pcm "output"
	}
	capture.pcm {
		type plug
		slave.pcm "input"
	}
}

pcm.output {
	type hw
	card 0
}

ctl.!default {
	type hw
	card 0
}

pcm.input {
	type hw
	card 0
}

everything looked fine but Speaker audio being routed some where else not pcm.output  – card 0. So decided to Delete:

pcm.!default {
	type asym
	playback.pcm {
		type plug
		slave.pcm "output"
	}
	capture.pcm {
		type plug
		slave.pcm "input"
	}
}

Rebooted Raspberry Pi lauched WebRTC and now we have Speaker and Mic audio.

What I think happining when the Raspberry Pi is booted for the first time with a HDMI to DVI monitor it selects the HDMI monitor speakers. The when I turned off the on board audio and made the USB Audio card 0 “zero”  then Rebooted the Rasperry Pi and selected the USB Audio Outputs/Inputs as default it inserted this in the .asoundrc file:

pcm.output {
	type hw
	card 0
}

ctl.!default {
	type hw
	card 0
}

pcm.input {
	type hw
	card 0
}

But it did not remove this:

pcm.!default {
	type asym
	playback.pcm {
		type plug
		slave.pcm "output"
	}
	capture.pcm {
		type plug
		slave.pcm "input"
	}
}

So I think WebRTC is still routing Speaker audio to the HDMI speakers.

Now when I leave onboard  Speakers On and use USB Michrophone with .asoundrc like this  WebRTC Speaker and Mic audio work fine.

pcm.!default {
	type asym
	playback.pcm {
		type plug
		slave.pcm "output"
	}
	capture.pcm {
		type plug
		slave.pcm "input"
	}
}

pcm.output {
	type hw
	card 0
}

ctl.!default {
	type hw
	card 0
}

pcm.input {
	type hw
	card 1
}

Who knows why WebRTC had no Speaker audio with the first .asoundrc configuration its working now…

Node.js Dependencies:

  1. http
  2. https
  3. http-auth
  4. express
  5. express-device
  6. socket.io
  7. sleep

^Top


Directory structure:

Raspberry Pi 3 Model B/B+
1. pi\webrtc-remote-rig

Windows – WebRTC/JavaScript compatible Browser:
1. PC Win7 (64 bit) – Firefox Quantum V-58.0.2 (64-bit)

Smart Phone – WebRTC/JavaScript compatible Browser:
1. Android Phone  Chrome Versions Tested –  V-76.0.3809.123  / V-77.0.3865.92  /  V-77.0.3865.116 / V-79.0.3945.93 /  V-79.0.3945.136
2. Android Phone OS – V-7.0; LG-K425 Build/NRD90U
3. Stop Google Updates Chrome <tap> Play Store -> <tap>  3-bar <tap> Settings <tap> Auto-update apps <tap> Don’t auto-update apps <tap> DONE

^Top


Hardware:

  1. Raspberry Pi 3 Model B/B+
  2. ICOM IC-7300
  3. USB Cable
  4. 5v 2.5amp power supply (Now using The DROK Buck Voltage Regulator)
  5. DROK Buck Voltage Regulator

^Top


Notes:

Tested on:
1. Vista
2. Win7-64
3. Android

Raspberry Pi Software Installed:

  1. Install 2018-10-09-raspbian-stretch-lite.img
  2. Install On/Off switch
  3. Install Xvfb
  4. Install Chroium-Browser V-72.0.3626.121
  5. Install webrtc-remote-rig (Costum – WebRTC Signaling / CAT Command Server).

IC-7300 Setup procedure:
Firmware V-1.2
1. Menu -> SET -> Connectors -> ACC/USB Output Select: AF
2. Menu -> SET -> Connectors -> ACC/USB Output Level: 90%
3. Menu -> SET -> Connectors -> USB MOD Level: 50%
4. Menu -> SET -> Connectors -> DATA OFF MOD: MIC,USB
5. Menu -> SET -> Connectors -> USB Serial Function: CI-V
6. Menu -> SET -> Connectors -> USB SEND: OFF
7. Menu -> SET -> Connectors -> CI-V -> CI-V Baud Rate: Auto
8. Menu -> SET -> Connectors -> CI-V -> CI-V Address: 94h
9. Menu -> SET -> Connectors -> CI-V -> CI-V Transceiver: ON
10. Menu -> SET -> Connectors -> CI-V -> CI-V Output (for ANT): OFF
11. Menu -> SET -> Connectors -> CI-V -> CI-V USB Port: Link to [REMOTE]
12. Menu -> SET -> Connectors -> CI-V -> CI-V USB Baud Rate: Auto
13. Menu -> SET -> Connectors -> CI-V -> CI-V USB Echo Back: Default OFF -> 3min

IC-7300 Interface to Rpi:
1. Connect a USB cable to the usb port on the IC-7300 and to the usb ports on the RPi.
2. Make sure power is applied to the radio. (It does not have to be on.)

Rpi to Router Interface:
1. If WiFi is not configured on RPi.
Then – Plug a cat5 network cable between the RPi network port and the Internet router.

Now: Apply power to boot up RPi .

Launch a WebRTC/JavaScript compatible Browser:  (e.g. chrome/firefox/opera on desktop/android) Enter the URL to WebRTC Remote Rig server and Login.

^Top


Conclusion:

It can’t get any easier than this to set up remote access to the IC-7300.

Install the WebRTC Remote Rig signaling server on the Raspberry Pi, launch a WebRTC/JavaScript compatible Browseron a PC/Android and start calling CQ .

Tested: On Vista, Win7, Android Phone and all worked. WebRTC Audio is very easy to use and Audio quality and Latency have much improved.

WebRTC :  Audio can be used with any Ham Radio Transceiver via a Raspberry Pi, a lot of the new Transceiver have built in USB I/O making remote access to the radio a lot easier.

Older Transceivers: Will need, for the Raspberry Pi – External USB Sound Card,  External RS232 / CIV interface.

Photo IC-7300 WebRTC Remote Rig: Blue Box, Raspberry Pi (running headless) accessing Internet via on-board WiFi, utilizing  WebRTC  Two way Audio / One way Video with a NodeJS Signaling  / CAT Command  Server. Only connections to the Raspberry Pi, USB Cable to IC-7300 and 5v power to Raspberry Pi.

Can’t get any simpler then this  to access the IC-7300 remotely via the Internet through a WebRTC/JavaScript compatible Browser on a PC or Smart Phone.

Note: Recently tested WebRTC Remote Rig on the IC-7600 .  Audio/ Video/CAT commands worked but have not updated the  IC-7600 Firmware to  version 2.0,  so have not tested Remote On/Off command 18-00 Off & 18-01 On.

The current experiment:  A Raspberry Pi with 5 inch touch screen connected via WiFi to the internet, running in Kiosk mode accessing  the WebRTC Remote Rig server which is connected to an IC-7300 via a USB cable ( The little blue box in the photo above is the WebRTC Remote Rig server ). Currently have a prototype Kiosk working. It is streaming WebRTC Audio /Video.

Here are some photos.

Keyboard Mouse Login:  Enter username/password Click Login.

Touch Keyboard Login –  Enter username/password Hide keyboard – Click Login.

Click ON button: To Connect to remote:

Remote connected: to IC-7300.

Click small websdr button: To view Band activity. (WebSDR audio either On or Off)

Click TX  controls button: To  Pop-up TX controls above main screen.

Click RX controls button:  Pop-up RX controls above main screen.

Active Radio functions displayed In Yellow above frequency .
Can also  Reset – Shutdown the Raspberry Pi through Web Client above.
Click OFF button: To Disconnect from remote.

Everything is working. Now have to make the enclosure.

Remote Ham Radio Google Chrome Web App:
3/12/2020: Now have a Google Chrome Web App on the Desktop, don’t have to launch the browser any more to access the IC7300 remotely. To bad Google decided to eliminate Chrome Web Apps. Made a Progressive Web Apps (PWA) Google replacement for Chrome Web Apps, but it does not work as nice as the old Chrome Web Apps. Works on Windows & Linux with WebRTC Audio.

Raspberry Pi Remote Ham Station Server:

Features:

  1. Save OFF/ON switch (Powers raspberry pi OFF after OS saved all file)
  2. Audio Speaker/Microphone  via WebRTC (Through external USB Audio adapter. Many modern radios today have USB  port which can be used as the Audio adaptor. )
  3. CAT Commands via USB – CIV – RS232 (Icom – Yaesu – Kenwood – Other)
  4. CAT command or Hard wire TX PTT
  5. Radio Display Video via WebRTC USB Webcam
  6. Network Access via Ethernet or WiFi
  7. Raspberry Pi 3 Model B – OS 2018-10-09-raspbian-stretch-lite

^Top


Reference Links:

1. Node.js – NPM
sudo wget http://nodejs.org/dist/v7.2.0/node-v7.2.0-linux-armv7l.tar.gz
2. Ham Radio Remote Control via Yaesu PCC / Raspberry Pi
3.Ham Radio Remote Base Web Audio API / Node.js Server>
4. Ham Radio Remote Base HTML5 Audio / Node.js Server
5. Ham Radio Internet Remote Base Via A Raspberry Pi
6. Ham Radio Remote Base A Complete Solution
7. Ham Radio Remote Base Audio Interface
8. Webrtc Audio Demo

^Top