Wizkers:radio server fails on start with "ReferenceError: define is not defined" error


#1

Hello,

I installed the server on a Raspberry Pi Stretch (fully udpated) per instructions on your website. When I run the server_start.sh script, I get the following error:

pi@raspberrypi:~/wizkers/wizkers/dist/server $ ./start_server.sh
DEPRECATION: Please use require('serialport') instead of require('serialport').SerialPort
/home/pi/wizkers/wizkers/dist/server/www/js/app/instruments/instrumentmanager.js:32
define(function (require) {
^

ReferenceError: define is not defined
at Object. (/home/pi/wizkers/wizkers/dist/server/www/js/app/instruments/instrumentmanager.js:32:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/wizkers/wizkers/dist/server/server.js:63:25)
at Module._compile (module.js:570:32)
pi@raspberrypi:~/wizkers/wizkers/dist/server $

Thanks,

Steve
AG7GN


#2

Hi Steve, what is the nodeJS version you are using?

I will push a bit update to the codebase this week-end, there are quite a few features that have been added in the development code that make Wizkers a lot more stable on a Raspberry Pi!


#3

Hi Ed,

v6.12.3

-Steve


#4

Just pushed a rather large update to Github.Can you do the following:

  • Delete the “node_modules” directory

  • git pull

  • Re-run “npm install”

  • OEM=radio gulp server

  • cd dist/server

  • ./start_server.sh

    … and let me know how it goes for you?

Ed


#5

(edit)

I found the issue on server code - I have mostly fixed it, you should be able to run on a Raspberry Pi with the latest “git pull”. What radio are you using for your tests, by the way ?

Please test and report!


#6

Hi Ed,

Thanks for getting back to me so quickly. I’m using a Kenwood TM-D710G, which should respond to most of the V71 commands. This latest git pull is quite a bit better. The server starts and I can connect to it from a Windows PC on TCP port 8090, log in and set up my radio and serial port.

Now I’m at the same place I am with the Wizkers:radio Chrome plugin (on Windows 10) and Chromium plugin (on the RPi): The RPi seems to talk to the radio, the CONNECT button turns green and says DISCONNECT FROM TM-V71A. But, when I click DEVICE SETUP > Memories > Read from Radio, nothing happens. This is true whether I’m using the Wizkers extension to talk directly to the radio from Win 10 (with serial cable attached to PC), or if I’m using the extension on the RPi to talk directly to the radio (with the serial cable connected to the RPi), or if I’m running the server on the RPi and I connect the extension to port 8090 on the RPi with the serial cable attached to the RPi.

When I run the server and attempt to Read from Device, I see this on the RPi console:

pi@raspberrypi:~/wizkers/wizkers/dist/server $ ./start_server.sh
wizkers:server Listening for new clients on port 8090 +0ms
wizkers:server Getting settings: { serialPort: ‘’,
timezone: ‘’,
cpmcolor: 0,
cpmscale: ‘linear’,
itemsperpage: 4,
currentInstrument: null,
currentUserRole: ‘pending’,
token: ‘invalid’,
showstream: false,
_id: ‘coresettings’,
_rev: ‘2-bf4837da819e958c6613247c49e88684’ } +189ms
wizkers:connectionmanager Instrument open request for instrument ID CA2C544C-34F9-8684-B12C-489BD6D77E43 +36ms
wizkers:connectionmanager Instrument is opening +33ms
wizkers:output Retrieving Outputs for Instrument ID: CA2C544C-34F9-8684-B12C-489BD6D77E43 +2ms
wizkers:server { ok: true,
wizkers:server id: ‘coresettings’,
wizkers:server rev: ‘3-77d046ecbe7208dec8aad117bc8da7e7’ } +13ms
wizkers:connections:serial Opening serial device at /dev/ttyUSB0 +38ms
wizkers:connections:serial Port open +32ms
Port status change { portopen: true }
wizkers:connections:serial null - undefined +40ms
wizkers:auth { local:
wizkers:auth { email: ‘admin’,
wizkers:auth password: ‘$2a$08$1BuhvegUlZrDmWwDn1D2zOzy.PNJzcDsvKJDrh9/l/u9AbHF0hAim’ },
wizkers:auth google: { id: ‘’, token: ‘’, email: ‘’, name: ‘’ },
wizkers:auth facebook: { id: ‘’, token: ‘’, email: ‘’, name: ‘’ },
wizkers:auth role: ‘admin’,
wizkers:auth _id: ‘admin’,
wizkers:auth _rev: ‘2-10f327fbf2d4d5e7ff084b372ec663c1’ } +21m
wizkers:server Processing login request +949ms
wizkers:server { serialPort: ‘’,
wizkers:server timezone: ‘’,
wizkers:server cpmcolor: 0,
wizkers:server cpmscale: ‘linear’,
wizkers:server itemsperpage: 4,
wizkers:server currentInstrument: ‘CA2C544C-34F9-8684-B12C-489BD6D77E43’,
wizkers:server token: ‘eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwicm9sZSI6ImFkbWluIiwiaWF0IjoxNTE1MzU4ODMzfQ.PWslt194ri11BcYK1aIE8lpeKLbN3cYDEmW0UooITK8’,
wizkers:server showstream: false,
wizkers:server enablestats: true,
wizkers:server id: 1,
wizkers:server currentUserRole: ‘admin’,
wizkers:server _id: ‘admin’,
wizkers:server _rev: ‘6-538c6026fff72eaf02985d151764b5c8’ } +18ms
wizkers:routes:settings getSettings { local:
{ email: ‘admin’,
password: ‘$2a$08$1BuhvegUlZrDmWwDn1D2zOzy.PNJzcDsvKJDrh9/l/u9AbHF0hAim’ },
google: { id: ‘’, token: ‘’, email: ‘’, name: ‘’ },
facebook: { id: ‘’, token: ‘’, email: ‘’, name: ‘’ },
role: ‘admin’,
_id: ‘admin’,
_rev: ‘2-10f327fbf2d4d5e7ff084b372ec663c1’ } +549ms
wizkers:server:socket admin connected +102ms
wizkers:server Updated userinfo role to admin +12ms
wizkers:server:socket We are switching to a new instrument ID: CA2C544C-34F9-8684-B12C-489BD6D77E43 +143ms
wizkers:server Open instrument request from front-end for CA2C544C-34F9-8684-B12C-489BD6D77E43 +2ms
wizkers:connectionmanager Instrument open request for instrument ID CA2C544C-34F9-8684-B12C-489BD6D77E43 +1ms
wizkers:connectionmanager That instrument is already loaded +0ms
wizkers:server:socket Unique ID requested by HTML app +8ms
wizkers:server:socket Controller command: { command: ‘get_tones’ } +3s
wizkers:server:socket data coming in for socket vUbLiZreumkj8HeuAAAB { tones:
[ 67,
69.3,
71.9,
74.4,
77,
79.7,
82.5,
85.4,
88.5,
91.5,
94.8,
97.4,
100,
103.5,
107.2,
110.9,
114.8,
118.8,
123,
127.3,
131.8,
136.5,
141.3,
146.2,
151.4,
156.7,
162.2,
167.9,
173.8,
179.9,
186.2,
192.8,
203.5,
206.5,
210.7,
218.1,
225.7,
229.1,
233.6,
241.8,
250.3,
254.1 ] } +3ms
wizkers:server:socket Controller command: { command: ‘get_dcs_codes’ } +10ms
wizkers:server:socket data coming in for socket vUbLiZreumkj8HeuAAAB { dcs_codes:
[ 23,
25,
26,
31,
32,
36,
43,
47,
51,
53,
54,
65,
71,
72,
73,
74,
114,
115,
116,
122,
125,
131,
132,
134,
143,
145,
152,
155,
156,
162,
165,
172,
174,
205,
212,
223,
225,
226,
243,
244,
245,
246,
251,
252,
255,
261,
263,
265,
266,
271,
274,
306,
311,
315,
325,
331,
332,
343,
346,
351,
356,
364,
365,
371,
411,
412,
413,
423,
431,
432,
445,
446,
452,
454,
455,
462,
464,
465,
466,
503,
506,
516,
523,
565,
532,
546,
565,
606,
612,
624,
627,
631,
632,
654,
662,
664,
703,
712,
723,
731,
… 4 more items ] } +1ms
[TM-V71A] Starting live data stream
[TM-V71A] Stopping live data stream
wizkers:server:socket Controller command: { command: ‘get_uid’ } +6s
wizkers:server:socket Controller command: { command: ‘get_tones’ } +39ms
wizkers:server:socket data coming in for socket vUbLiZreumkj8HeuAAAB { tones:
[ 67,
69.3,
71.9,
74.4,
77,
79.7,
82.5,
85.4,
88.5,
91.5,
94.8,
97.4,
100,
103.5,
107.2,
110.9,
114.8,
118.8,
123,
127.3,
131.8,
136.5,
141.3,
146.2,
151.4,
156.7,
162.2,
167.9,
173.8,
179.9,
186.2,
192.8,
203.5,
206.5,
210.7,
218.1,
225.7,
229.1,
233.6,
241.8,
250.3,
254.1 ] } +1ms

Regards,

Steve


#7

Ed,

I meant to add to my previous message that I can use the Kenwood MCP app, Chirp, and RT Systems with this same cable on the same Windows 10 laptop and talk to the radio with no problems.

Steve


#8

I read on another forum that you had tested this with a Kenwood TH-D72A. I happen to have one of those also, and just tried it instead of the 710. I get the same results (nothing happens when I click Read from Device).

I’ve connected the USB cable between the TM-D72A’s USB port and the RPi.

Output on server console:

wizkers:server Open instrument request from front-end for CA2C544C-34F9-8684-B12C-489BD6D77E43 +47s
wizkers:connectionmanager Instrument open request for instrument ID CA2C544C-34F9-8684-B12C-489BD6D77E43 +1ms
wizkers:connectionmanager Instrument is opening +7ms
wizkers:output Retrieving Outputs for Instrument ID: CA2C544C-34F9-8684-B12C-489BD6D77E43 +1ms
wizkers:connections:serial Opening serial device at /dev/ttyUSB0 +15ms
wizkers:connections:serial Port open +9ms
Port status change { portopen: true }
wizkers:connections:serial null - undefined +5ms
wizkers:server:socket Unique ID requested by HTML app +3s
wizkers:server:socket Controller command: { command: ‘get_tones’ } +53ms
wizkers:server:socket data coming in for socket CjxG-1ZHWBLaAmrWAAAB { tones:
[ 67,
69.3,
71.9,
74.4,
77,
79.7,
82.5,
85.4,
88.5,
91.5,
94.8,
97.4,
100,
103.5,
107.2,
110.9,
114.8,
118.8,
123,
127.3,
131.8,
136.5,
141.3,
146.2,
151.4,
156.7,
162.2,
167.9,
173.8,
179.9,
186.2,
192.8,
203.5,
206.5,
210.7,
218.1,
225.7,
229.1,
233.6,
241.8,
250.3,
254.1 ] } +2ms
wizkers:server:socket Controller command: { command: ‘get_dcs_codes’ } +13ms
wizkers:server:socket data coming in for socket CjxG-1ZHWBLaAmrWAAAB { dcs_codes:
[ 23,
25,
26,
31,
32,
36,
43,
47,
51,
53,
54,
65,
71,
72,
73,
74,
114,
115,
116,
122,
125,
131,
132,
134,
143,
145,
152,
155,
156,
162,
165,
172,
174,
205,
212,
223,
225,
226,
243,
244,
245,
246,
251,
252,
255,
261,
263,
265,
266,
271,
274,
306,
311,
315,
325,
331,
332,
343,
346,
351,
356,
364,
365,
371,
411,
412,
413,
423,
431,
432,
445,
446,
452,
454,
455,
462,
464,
465,
466,
503,
506,
516,
523,
565,
532,
546,
565,
606,
612,
624,
627,
631,
632,
654,
662,
664,
703,
712,
723,
731,
… 4 more items ] } +2ms
[TM-V71A] Starting live data stream
[TM-V71A] Stopping live data stream
wizkers:server:socket Controller command: { command: ‘get_uid’ } +6s
wizkers:server:socket Controller command: { command: ‘get_tones’ } +47ms
wizkers:server:socket data coming in for socket CjxG-1ZHWBLaAmrWAAAB { tones:
[ 67,
69.3,
71.9,
74.4,
77,
79.7,
82.5,
85.4,
88.5,
91.5,
94.8,
97.4,
100,
103.5,
107.2,
110.9,
114.8,
118.8,
123,
127.3,
131.8,
136.5,
141.3,
146.2,
151.4,
156.7,
162.2,
167.9,
173.8,
179.9,
186.2,
192.8,
203.5,
206.5,
210.7,
218.1,
225.7,
229.1,
233.6,
241.8,
250.3,
254.1 ] } +1ms
wizkers:server:socket Controller command: { command: ‘get_memory’, arg: 0 } +9s
wizkers:server:socket Controller command: { command: ‘get_memory’, arg: 0 } +9s


#9

Ed,

OK, I was looking at the source code in oem/radio/www/js/app/instruments/kenwood_v71/driver_backend.js and I see you expect that the baud rate of the serial interface be 9600. My TM-D710G was at 57600. I changed it to 9600 and I can now see the display reflect the radio settings (to the extent that the V71A image can with a D710G radio) and I can retrieve the radio’s memories. I am not able to do anything but select a memory from the web interface and have it change the radio, though. I can not set VFO or mode or power level or switch bands, for example. Is that expected?

I tried it with my TH-D72A also and I see the same behavior.

Steve


#10

Great to see you made progress! Yes, I should really add some sort of autodetect for the baud rate, thanks for the reminder.

As far as I know, there is actually no way for those radios to tune to a specific VFO from the CAT protocol, believe it or not. I would love to be corrected on that topic, but it really looks like it is not possible.

The way I use the interface on a day to day basis, is when I log on remotely to the Pi to use it as an AX25 terminal, I use the Wizkers web interface to switch from one pre-programmed frequency to another, but I never tune around.

If you know of anyone who has more info on protocol commands for this radio that would enable direct VFO tuning, that would be awesome!

Ed