'name 'cmd0' is not defined'

Posted on
Fri Aug 19, 2022 2:03 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

'name 'cmd0' is not defined'

I swear I had three pibeacons workign properly about 7 years ago, and now for the life of me I can't get one up with your pre-configured image. The pi is detected by the plugin, but when the plugin tells it to reboot, or before that, the log below.

Anybody who can help me, very appreciated. I already deleted the old line from nano /Users/USERNAME/.ssh/known_hosts on my mac


Code: Select all
2022-08-19 15:47:14  ..   startup(self): setting variables, debug ..   finished
2022-08-19 15:47:14 entering init runConcurrentThread
2022-08-19 15:47:14 MAP2Vendor initializing with python v:3
2022-08-19 15:47:14 MAP2Vendor initializing  finished, read from mac2Vendor.json file
2022-08-19 15:47:14 MAP2Vendor initializing  finished, read from mac2Vendor.json file
2022-08-19 15:47:14 setting BeaconsCheck to off (no up-->down) for  50 secs requested by: initConcurrentThread
2022-08-19 15:47:14  ..   starting tcpip socket listener, for RPI data, might take some time, using: ip#=192.168.1.12 ;  port#= 12087
2022-08-19 15:47:14  ..   startTcpipListening lsof output: -
2022-08-19 15:47:14  ..   startTcpipListening try#: 0 time elapsed:  0.1 secs; resp: [Errno 48] Address already in use
2022-08-19 15:47:22  ..   startTcpipListening try#: 1 time elapsed:  7.2 secs; resp: [Errno 48] Address already in use
2022-08-19 15:47:29  ..   startTcpipListening try#: 2 time elapsed: 14.4 secs; resp: [Errno 48] Address already in use
2022-08-19 15:47:36  ..   startTcpipListening try#: 3 time elapsed: 21.5 secs; setting re-use = 1; timout = 5
2022-08-19 15:47:36  ..   startTcpipListening /usr/sbin/lsof -i tcp:12087   output:
COMMAND     PID        USER   FD   TYPE            DEVICE SIZE/OFF NODE NAME
IndigoPlu 72922 MACUSERNAME    8u  IPv4 0x19874972d6460db      0t0  TCP 192.168.1.12:12087 (LISTEN)
2022-08-19 15:47:36  ..   startTcpipListening tcpip socket listener running; thread-ID: Thread-2 (serve_forever)
2022-08-19 15:47:36 setting BeaconsCheck to off (no up-->down) for  40 secs requested by: initConcurrentThread
2022-08-19 15:47:36  ..   checking sensors
2022-08-19 15:47:36  ..   checking BLEconnect
2022-08-19 15:47:36  ..   checking beacons
2022-08-19 15:47:36 updating pi server files called from:
2022-08-19 15:47:36  ..  checking for new py programs for RPIs;  currentV:2022.146.6, newV:2022.146.6
2022-08-19 15:47:36 checkForUpdates updateNeeded   findAnyTaskPi: True
2022-08-19 15:47:36 FTP adding to update list {'pi': '0', 'fileToSend': 'updateParamsFTP.exp', 'endAction': 'repeatUntilFinished', 'type': 'ftp', 'tries': 0, 'exeTime': 1660938456.432273}
2022-08-19 15:47:36 rpiUpdateThread executing  {'pi': '0', 'fileToSend': 'updateParamsFTP.exp', 'endAction': 'repeatUntilFinished', 'type': 'ftp', 'tries': 0, 'exeTime': 1660938456.432273}
2022-08-19 15:47:36 enter  sendFilesToPiFTP #0  fileToSend:
2022-08-19 15:47:36 SSH adding to update list {'pi': '0', 'fileToSend': 'rebootSSH.exp', 'endAction': 'repeatUntilFinished', 'type': 'ssh', 'tries': 0, 'exeTime': 1660938456.729229}
2022-08-19 15:47:36 setting BeaconsCheck to off (no up-->down) for  50 secs requested by: initConcurrentThread
2022-08-19 15:47:36  ..  initialized, starting loop
2022-08-19 15:47:37  sbin/ping  -c 1 -W 40 -o 192.168.1.118 return-code: 2
2022-08-19 15:47:39 /sbin/ping  -c 1 -W 400 -o 192.168.1.118 ret-code:
2022-08-19 15:47:39  pi server # 0  PI# 192.168.1.118    not online - does not answer ping - , skipping update
2022-08-19 15:47:39 rpiUpdateThread executing  {'pi': '0', 'fileToSend': 'rebootSSH.exp', 'endAction': 'repeatUntilFinished', 'type': 'ssh', 'tries': 0, 'exeTime': 1660938456.729229}
2022-08-19 15:47:40  sbin/ping  -c 1 -W 40 -o 192.168.1.118 return-code: 2
2022-08-19 15:47:41 /sbin/ping  -c 1 -W 400 -o 192.168.1.118 ret-code:
2022-08-19 15:47:41 rebootSSH.exp Pi# 0
/usr/bin/expect '/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/rebootSSH.exp'  pi MYPASSWORD assword 192.168.1.118 15  &
2022-08-19 15:47:41.035   ERROR          Plugin.exceptionHandler          'name 'cmd0' is not defined'
execSshToRPI @line 18578: 'ret, err = self.readPopen(cmd0)'
2022-08-19 15:47:42 rpiUpdateThread executing  {'pi': '0', 'fileToSend': 'updateParamsFTP.exp', 'endAction': 'repeatUntilFinished', 'type': 'ftp', 'tries': 1, 'exeTime': 1660938464.586887}
2022-08-19 15:47:42 rpiUpdateThread executing  {'pi': '0', 'fileToSend': 'rebootSSH.exp', 'endAction': 'repeatUntilFinished', 'type': 'ssh', 'tries': 1, 'exeTime': 1660938466.036045}
2022-08-19 15:47:43 rpiUpdateThread executing  {'pi': '0', 'fileToSend': 'updateParamsFTP.exp', 'endAction': 'repeatUntilFinished', 'type': 'ftp', 'tries': 1, 'exeTime': 1660938464.586887}
2022-08-19 15:47:43 rpiUpdateThread executing  {'pi': '0', 'fileToSend': 'rebootSSH.exp', 'endAction': 'repeatUntilFinished', 'type': 'ssh', 'tries': 1, 'exeTime': 1660938466.036045}
2022-08-19 15:47:44 rpiUpdateThread executing  {'pi': '0', 'fileToSend': 'updateParamsFTP.exp', 'endAction': 'repeatUntilFinished', 'type': 'ftp', 'tries': 1, 'exeTime': 1660938464.586887}
2022-08-19 15:47:44 rpiUpdateThread executing  {'pi': '0', 'fileToSend': 'rebootSSH.exp', 'endAction': 'repeatUntilFinished', 'type': 'ssh', 'tries': 1, 'exeTime': 1660938466.036045}
2022-08-19 15:47:45 rpiUpdateThread executing  {'pi': '0', 'fileToSend': 'updateParamsFTP.exp', 'endAction': 'repeatUntilFinished', 'type': 'ftp', 'tries': 1, 'exeTime': 1660938464.586887}
2022-08-19 15:47:45 enter  sendFilesToPiFTP #0  fileToSend:
2022-08-19 15:47:45  sbin/ping  -c 1 -W 40 -o 192.168.1.118 return-code: 0
2022-08-19 15:47:45 updating pi server config for # 0 executing
/usr/bin/expect '/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/updateParamsFTP.exp' pi MYPASSWORD assword 192.168.1.118 0 '/Library/Application Support/Perceptive Automation/Indigo 2022.1/Preferences/Plugins/com.karlwachs.piBeacon/' '/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/pi' 15
2022-08-19 15:47:50 UpdateRPI seems to have been completed for pi# 0  updateParamsFTP.exp
2022-08-19 15:47:50 rpiUpdateThread executing  {'pi': '0', 'fileToSend': 'rebootSSH.exp', 'endAction': 'repeatUntilFinished', 'type': 'ssh', 'tries': 1, 'exeTime': 1660938466.036045}
2022-08-19 15:47:50  sbin/ping  -c 1 -W 40 -o 192.168.1.118 return-code: 0
2022-08-19 15:47:50 rebootSSH.exp Pi# 0
/usr/bin/expect '/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/rebootSSH.exp'  pi MYPASSWORD assword 192.168.1.118 15  &
2022-08-19 15:47:50.731   ERROR          Plugin.exceptionHandler          'name 'cmd0' is not defined'
execSshToRPI @line 18578: 'ret, err = self.readPopen(cmd0)'

Posted on
Fri Aug 19, 2022 2:20 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: 'name 'cmd0' is not defined'

I have posted a version on GitHub that should fix the error. .. GitHub kw123

I am out of town until tomorrow evening. And I can not access my home network . There was a thunderstorm and now everything is off line.
I have to check first when I am home.

Karl


Sent from my iPhone using Tapatalk

Posted on
Fri Aug 19, 2022 2:57 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: 'name 'cmd0' is not defined'

Wow! Thanks for the speedy response!

It appears I can now ssh reboot the pi, but I'm getting this when I try to send the BLEAnalysis command (also, no bluetooth devices are populated in Indigo):

Code: Select all
2022-08-19 17:31:32 rPi alive message :  {"last_masterStart":"2022-08-19 16:30:56","last_boot":"2022-08-19 16:30:40","RPI_throttled":"E#19 Soft temp limit occd","temp":"60.1","rpi_type":"Pi 3 Model B Plus Rev 1.3, ser#84cc99b8","program":"master","sensors_active":"","pi":"0","ipAddress":"192.168.1.118","op_sys":"10 (buster), 5.10.17-v7+, #1403 SMP Mon Feb 22 11:29:51 GMT 2021","i2c_active":""}
2022-08-19 17:31:49 sending command to rPi at 192.168.1.118; port: 9999; cmd:BLEAnalysis
2022-08-19 17:31:49.233   ERROR          Plugin.exceptionHandler          'name 'cmds' is not defined'
sendGPIOCommand @line 17571: 'if self.decideMyLog("OutputDevice"): self.indiLOG.log(5,   "sendGPIOCommand: " + cmds)'
2022-08-19 17:32:01 new iBeacon message-----------------------------------
 {"msgs":[],"secsCol":30,"reason":"timer","program":"beaconloop","pi":"0","ipAddress":"192.168.1.118","piMAC":"B8:27:EB:66:33:12"}

Posted on
Sat Aug 20, 2022 4:41 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: 'name 'cmd0' is not defined'

I will check later tonight when I am home and my network is back.

Karl


Sent from my iPhone using Tapatalk

Posted on
Sat Aug 20, 2022 3:22 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: 'name 'cmd0' is not defined'

unfortunately my internet modem is bust, I can get a new one on Monday morning.

I am currently using my cellphone through wifi hot spot to get to the internet

will see what I can do with that.


Karl

re internet: Austria is a really nice country with a lot of advantages. BUT internet is not one of them .. ~ 10 years behind.

I tried 5G modem, that went from ~300/30Mbit over time down to 30/5Mbit with several outages a day. Then switched to DSL 100/20Mbit, that was stable for ~ 3 weeks, now that modem went bad.

I guess I need 2 DSL lines or DSL + 5G as backup.

Posted on
Sat Aug 20, 2022 4:24 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: 'name 'cmd0' is not defined'

I can look at the code.


a quick fix:
in config/ turn OFF debugging for "output devices" that is a logging format error, left over from py2 --> py3 conversion

you then need to update the software on the RPI:
then menu / send-get ...
select all rpi
click send program and config files ..
wait 1 minute
click Restart master.py through ssh

will post a fixed version if I can upload through my iPhone.

Karl

Posted on
Sat Aug 20, 2022 5:08 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: 'name 'cmd0' is not defined'

I was able to do some LAN config and the iPhone connection is not that slow.

uploaded to GitHub
https://github.com/kw123/pibeacon/releases/tag/2022.148.10

that should fix your errors

Karl

Posted on
Sun Aug 21, 2022 8:42 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: 'name 'cmd0' is not defined'

I have no idea how you do it, but everything appears to be working for reasons totally outside of my understanding! Thank you!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests