"Disconnected M161 M163"

Hello,

I haven’t used my machine in quite a while. I turned it on and get the Web UI of KC up (using network cable).

The UI says the machine is disconnected and I can’t get it to connect. Clicking Reset doesn’t change anything.

Either I am forgetting something incredibly basic or there might be an issue…

The red light on the machine is flashing. If I press this it stays on but no change to web UI.

The odd thing is in Config->Server there is not network info at all (see screenshot).

I have upgraded to the latest software (5.6.0) but this didn’t change anything…

I am able to SSH to the machine over the network.

I would appreciate if you could provide me some troubleshooting steps to try out…

Did this behavior start before the update to v5.6.0?

In this update there were many changes about the system. It sounds like something is preventing your main services from starting. If you could run these commands, it would be helpful for us to reproduce the issue:

This will show us what version you were on previous to the update:

sudo ostree admin status

These will hopefully show what is causing the services to fail to start:

cat ~/linuxcnc_*
tail -n 50 /var/log/hal.log

One more command that may show something too:

tail -n 50 /var/log/linuxcnc_webserver.log

Also, in case it wasn’t clear, the above commands need to be entered in the terminal after SSH’ing to the machine.

Thanks for the fast reply.

This occurred before upgrade. I thought maybe the upgrade would sort it out :crazy_face:

Here are the results:

pocketnc@pocketnc:~$ sudo ostree admin status
* kinetic a7fb35aa5c4369dd42b59c0494ede843cbeb84e644a3845f69ba97e565f4363f.0
    Version: 5.6.0
    origin refspec: a7fb35aa5c4369dd42b59c0494ede843cbeb84e644a3845f69ba97e565f4363f
  kinetic cceb918fac5c0fef8dd5b404a637e401b35c6f57d060e03bea34c3c0ce57ebeb.0 (rollback)
    Version: 5.5.3
    origin refspec: cceb918fac5c0fef8dd5b404a637e401b35c6f57d060e03bea34c3c0ce57ebeb
pocketnc@pocketnc:~$ cat ~/linuxcnc_*
Can not find -sec DISPLAY -var INTRO_GRAPHIC -num 1
Can not find -sec DISPLAY -var INTRO_TIME -num 1
rtapi_msgd command:  /usr/libexec/machinekit/rtapi_msgd --instance=0 --rtmsglevel=1 --usrmsglevel=1 --debug=1 --halsize=524288
rtapi_app command:  /usr/libexec/machinekit/rtapi_app --instance=0 --debug=1
3::1714:rt INFO:  Picked default flavor 'rt-preempt' automatically
Waiting for component 'spindle_speed' to become ready........
Waiting for component 'hss_sensors' to become ready.....
Waiting for component 'hss_state' to become ready....................................

Waiting for component 'timekeeper' to become ready.........
Waiting for component 'inihal' to become ready...............................................................................................................................................................................................................................................................................................................................................................................................................
Terminated
1698
1874
Stopping realtime threads
Unloading hal components
RUN_IN_PLACE=yes
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/opt/source/pocketnc/emcapplication/bin
LINUXCNC_TCL_DIR=/opt/source/pocketnc/emcapplication/tcl
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/opt/source/pocketnc/emcapplication/src/objects
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
LINUXCNC - 2.9.0~pre0
Machine configuration directory is '/var/opt/pocketnc'
Machine configuration file is 'PocketNC.ini'
INIFILE=/var/opt/pocketnc/PocketNC.ini
VERSION=1.1
check_config: Unchecked: [KINS]KINEMATICS=xyzab-trt-kins
PARAMETER_FILE=pru-stepper.var
TASK=milltask -param_zmq_addr ipc:///tmp/pocketnc_params
HALUI=halui
DISPLAY=dummy.sh
COORDINATES=XYZAB
KINEMATICS=xyzab-trt-kins
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Found file(ABS): /opt/pocketnc/Settings/features/penta/penta.hal
Found file(ABS): /opt/pocketnc/Settings/features/bb_gpio/bb_gpio.hal
Found file(ABS): /opt/pocketnc/Settings/features/v2_limit_switches/v2_limit_switches.hal
Found file(ABS): /opt/pocketnc/Settings/features/v2_spindle_control/v2_spindle_control.hal
Found file(ABS): /opt/pocketnc/Settings/features/v2_motor_control/v2_motor_control.hal
Found file(ABS): /opt/pocketnc/Settings/features/high_speed_spindle/high_speed_spindle.hal
Found file(ABS): /opt/pocketnc/Settings/features/loop_back_estop/loop_back_estop.hal
Found file(ABS): /opt/pocketnc/Settings/features/loop_back_tool_change/loop_back_tool_change.hal
Found file(ABS): /opt/pocketnc/Settings/features/run_time_clock/run_time_clock.hal
Found file(ABS): /opt/pocketnc/Settings/features/timekeeper/timekeeper.hal
Found file(ABS): /opt/pocketnc/Settings/features/v2_delayed_enable/v2_delayed_enable.hal
Found file(ABS): /opt/pocketnc/Settings/features/v2_estop_button/v2_estop_button.hal
Found file(ABS): /opt/pocketnc/Settings/features/v2_feed_rate_calculation/v2_feed_rate_calculation.hal
Found file(ABS): /opt/pocketnc/Settings/features/v2_leds/v2_leds.hal
Found file(ABS): /opt/pocketnc/Settings/features/v2_start_button/v2_start_button.hal
Found file(ABS): /opt/pocketnc/Settings/features/v2_tool_setter/v2_tool_setter.hal
Found file(ABS): /opt/pocketnc/Settings/features/xyzab_kinematics/xyzab_kinematics.hal
Starting TASK program: milltask -param_zmq_addr ipc:///tmp/pocketnc_params
Starting DISPLAY program: dummy.sh
Started dummy display!
task: main loop took 0.166445 seconds
Shutting down and cleaning up LinuxCNC...
task: main loop took 0.128257 seconds
task: main loop took 0.108895 seconds
task: main loop took 0.129063 seconds
task: main loop took 0.137108 seconds
task: main loop took 0.119567 seconds
task: main loop took 0.121761 seconds
task: main loop took 0.138768 seconds
task: main loop took 0.120542 seconds
task: 51915 cycles, min=0.002899, max=0.138768, avg=0.012039, 9 latency excursions (> 10x expected cycle time of 0.010000s)
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments
pocketnc@pocketnc:~$ tail -n 50 /var/log/hal.log
May 20 11:17:11 pocketnc msgd:0: hal_lib:1702:rt    Joint 4 ==> Axis B
May 20 11:17:42 pocketnc msgd:0: hal_lib:1727:user halui: emcCommandSend: no echo from Task after 5.000 seconds
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc rtapi:0: unload: '' not loaded
May 20 11:20:01 pocketnc msgd:0: rtapi_app exit detected - scheduled shutdown
May 20 11:20:03 pocketnc msgd:0: msgd shutting down
May 21 12:32:25 pocketnc msgd:0: zeroconf: connecting - mDNS server not yet available (avahi-daemon not installed or not runnung?)
May 21 12:32:27 pocketnc msgd:0: hal_lib:1714:rt
May 21 12:32:27 pocketnc msgd:0: hal_lib:1714:rt xyzab-trt-kins coordinates=xyzab assigns:
May 21 12:32:27 pocketnc msgd:0: hal_lib:1714:rt    Joint 0 ==> Axis X
May 21 12:32:27 pocketnc msgd:0: hal_lib:1714:rt    Joint 1 ==> Axis Y
May 21 12:32:27 pocketnc msgd:0: hal_lib:1714:rt    Joint 2 ==> Axis Z
May 21 12:32:27 pocketnc msgd:0: hal_lib:1714:rt    Joint 3 ==> Axis A
May 21 12:32:27 pocketnc msgd:0: hal_lib:1714:rt    Joint 4 ==> Axis B
May 21 12:32:55 pocketnc msgd:0: hal_lib:1729:user halui: emcCommandSend: no echo from Task after 5.000 seconds
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc rtapi:0: unload: '' not loaded
May 21 12:44:11 pocketnc msgd:0: rtapi_app exit detected - scheduled shutdown
May 21 12:44:13 pocketnc msgd:0: msgd shutting down
May 21 13:03:26 pocketnc msgd:0: hal_lib:1787:rt
May 21 13:03:26 pocketnc msgd:0: hal_lib:1787:rt xyzab-trt-kins coordinates=xyzab assigns:
May 21 13:03:26 pocketnc msgd:0: hal_lib:1787:rt    Joint 0 ==> Axis X
May 21 13:03:26 pocketnc msgd:0: hal_lib:1787:rt    Joint 1 ==> Axis Y
May 21 13:03:26 pocketnc msgd:0: hal_lib:1787:rt    Joint 2 ==> Axis Z
May 21 13:03:26 pocketnc msgd:0: hal_lib:1787:rt    Joint 3 ==> Axis A
May 21 13:03:26 pocketnc msgd:0: hal_lib:1787:rt    Joint 4 ==> Axis B
May 21 13:03:38 pocketnc msgd:0: hal_lib:1854:user halg_link:264 HAL error: ASSERTION VIOLATED: '*data_ptr_addr != NULL'
May 21 13:04:02 pocketnc msgd:0: hal_lib:1804:user halui: emcCommandSend: no echo from Task after 5.000 seconds

One thing: Since the last time I installed new network switches (between web UI and machine). I’m not quite sure how the PocketNC behaves on the networking side i.e. is there more than one IP which needs to be connected to from the browser? Maybe my switch is blocking something…?

Sorry, also:

pocketnc@pocketnc:~$ tail -n 50 /var/log/linuxcnc_webserver.log
Traceback (most recent call last):
  File "/opt/source/pocketnc/python/tornado/websocket.py", line 1092, in wrapper
    await fut
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/source/pocketnc/python/tornado/websocket.py", line 1094, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
2023-06-05 02:39:40,229Z pid:3109 module:base_events Task exception was never retrieved
future: <Task finished coro=<WebSocketProtocol13.write_message.<locals>.wrapper() done, defined at /opt/source/pocketnc/python/tornado/websocket.py:1090> exception=WebSocketClosedError()>
Traceback (most recent call last):
  File "/opt/source/pocketnc/python/tornado/websocket.py", line 1092, in wrapper
    await fut
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/source/pocketnc/python/tornado/websocket.py", line 1094, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
2023-06-05 02:39:40,239Z pid:3109 module:base_events Task exception was never retrieved
future: <Task finished coro=<WebSocketProtocol13.write_message.<locals>.wrapper() done, defined at /opt/source/pocketnc/python/tornado/websocket.py:1090> exception=WebSocketClosedError()>
Traceback (most recent call last):
  File "/opt/source/pocketnc/python/tornado/websocket.py", line 1092, in wrapper
    await fut
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/source/pocketnc/python/tornado/websocket.py", line 1094, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
2023-06-05 02:39:40,252Z pid:3109 module:base_events Task exception was never retrieved
future: <Task finished coro=<WebSocketProtocol13.write_message.<locals>.wrapper() done, defined at /opt/source/pocketnc/python/tornado/websocket.py:1090> exception=WebSocketClosedError()>
Traceback (most recent call last):
  File "/opt/source/pocketnc/python/tornado/websocket.py", line 1092, in wrapper
    await fut
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/source/pocketnc/python/tornado/websocket.py", line 1094, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError

Ok, it looks like everything is starting up ok, but seems like something is causing the connection between the UI and the web socket server to close. I think the easiest test would be to connect with a USB cable and make sure that still works before digging deeper into what’s going on with the network.

Could you attach the full /var/log/linuxcnc_webserver.log file? If you’re able to connect with the USB cable, you should be able to download it from the History tab. If not, you’ll have to copy it over SSH, or cat the file and copy the output from the terminal:

cat /var/log/linuxcnc_webserver.log

My best guess is something between your computer and the Pocket NC is blocking port 8000.

Alternatively, the web socket server does check a list of valid addresses that are allowed to connect. The default list is made up of all of the Pocket NC’s network interfaces. If you’re doing some kind of local DNS to remap your IP address, then you’ll need to explicitly add that address to the Pocket NC so it allows web socket connections from it. To do so, you can run the following command (be sure to replace the <your domain> with what you’ve remapped it as):

echo "export ALLOWED_DOMAINS=http://<yourdomain>" >> ~/.pocketnc_env

If you ever need to make changes, you can edit the ~/.pocketnc_env file.

Ok - that is definitely looking like it is my new network setup.

Thanks for the pointers - I will try to sort it out and let you know.

Thanks again for quick responses.

This was it! Thanks so much! :pray:

1 Like