• RAE
  • RAE, Wifi without Robothub instructions not working

Hi @Vinny
Try running rm /var/run/wpa_supplicant and then initializing it again. Easiest solution to the issue you are experiencing is probably factory reset and then connecting using the QR (on 1.12 please).

Thanks,
Jaka

a month later

Following up on this, after a factory reset (bottom pin pressed after disabling robothub-ctl), and then setting up the connection to the local network using this:

https://docs-beta.luxonis.com/hardware/rae/get-started?v=Advanced+%28manual%29

on reboot, the connection to the local wifi only occurs after this sequence (connected via USB):

root@keembay:~# systemctl stop hostapd
root@keembay:~# wpa_supplicant -B -i wlp1s0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
nl80211: kernel reports: Match already configured
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlp1s0 disabled_11b_rates=0
wlp1s0: Failed to initialize driver interface
root@keembay:~# wpa_supplicant -B -i wlp1s0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
root@keembay:~# systemctl restart systemd-networkd

Note having to enter wpa_supplicant -B -i wlp1s0 -c /etc/wpa_supplicant.conf twice.

Maybe on boot this errors out after the first attempt, preventing the local wifi to be configured?

That is exactly how it is with my RAE. Except that I have to go through this procedure every time I restart the device. Did you figure out I way how to get this persistent into RAE?

I tried adding a system service in /etc/systemd/system to start a service last with (partial entry):

[Service]
User=root
Type=simple
ExecStart=/bin/bash -c 'systemctl stop hostapd && wpa_supplicant -B -i wlp1s0 -c /etc/wpa_supplicant.conf && systemctl restart systemd-networkd && wpa_supplicant -B -i wlp1s0 -c /etc/wpa_supplicant.conf'
TimeoutSec=30
Restart=on-failure
RestartSec=10

[google starting a system service last for examples] which was not successful. It seems to modify this behavior means accessing the write protected portions of the file system. For now until this issue is addressed by Luxonis the best I have come up with is to add this to .bashrc, but that then requires logging in as root using the usb ssh root@192.168.197.55:

systemctl stop hostapd
wpa_supplicant -B -i wlp1s0 -c /etc/wpa_supplicant.conf
systemctl restart systemd-networkd
wpa_supplicant -B -i wlp1s0 -c /etc/wpa_supplicant.conf

When you quit terminal, the local wifi should persist.

Luxonis - any help here?

Hey,

We have generally used advanced setup to set robot up for using RH if anything is broken - and that generally included ssh from cable and connecting to internet with wpa supplicant being active. It was never really meant to persist after reboot.

Have you tried connecting via Robothub? It would be RH cloud part of documentation - that way RobotHub would manage network connection. After you do that once unless you delete RH data from the robot RH agent should maintain connection.

If there is a reason you are avoiding RH, I can probably try and spin up a service that will establish network connection - granted I would suggest adding robot to RH and letting it handle network connection.

    I have not had any luck connecting and using RH, so I tried just building the ros2 docker image luxonis/rae-ros-robot:humble on another machine and transferring it to the rae via scp per luxonis/rae-ros#ssh. Then, I can run the container and make sure the ROS_DOMAIN_ID is exposed on the local network to use rviz2 on another machine, and run one of the packages for testing.

    Here are the issues I had even getting RH and the rae (unsuccessfully) connected:

    • Hard reset
    • Plugged in to USB
    • Signed on to RobotHub
    • Went through the QR code process
    • Blue light flashes - says connecting to my SSID
    • Red flashes - then light blue
    • Screen says: Connected to RobotHub
    • Rae self reboots
    • Rae now appears on RH Site
    • Rae getting really hot
    • RH says rae is "Ready" but video preview unavailable (black alert box: "Connection timeout …)
    • top shows:
       1572 root      20   0 1951564 118852  29392 S  14.6   4.1   3:13.66 depthai-device-
       1461 robothub  20   0 1201148 158896  32992 S   6.0   5.5   1:27.42 python3
        968 robothub  20   0 1161792  99504  41508 S   1.3   3.4   0:22.63 node
        377 root      20   0   46848  14156  12796 S   1.0   0.5   0:13.77 systemd-journal
        536 root      20   0  288688   3976   2520 S   0.7   0.1   0:06.21 rsyslogd
        735 root      20   0 1476552  46300  19812 S   0.7   1.6   0:04.30 containerd
         84 root      20   0       0      0      0 S   0.3   0.0   0:01.32 kmb_ipc_tx_thre
        524 root      20   0  405256  33140   7928 S   0.3   1.1   0:06.15 python3
        567 root     -51   0       0      0      0 S   0.3   0.0   0:00.14 irq/52-dwc3
        969 robothub  20   0  175792   5724   5036 S   0.3   0.2   0:03.86 rae_process
       1861 root      20   0    4736   2420   1916 R   0.3   0.1   0:04.53 top
       2052 root      20   0       0      0      0 I   0.3   0.0   0:00.13 kworker/u8:1-e+
       2078 root      20   0  938896  83312  40004 S   0.3   2.9   0:14.21 node
       2154 root      20   0  958108  86032  39272 S   0.3   3.0   0:08.03 node
       2178 root      20   0  676532  59356  37340 S   0.3   2.0   0:02.47 node
    • Can connect using https:192.168.1.66:9010 (note - the connection is insecure) - but no preview, no welcome screen, no control button
    • Still very hot even though there doesn't appear to be much activity.
    • Turned Rae off (bottom button) and restarted after 1 minute
    • RH Site said device online, upgrading/provisioning in progress
    • Process stalled at "Waiting for device to connect ..."
    • Now RH site says Rae's status is "Outage"
    • Rae's display just says Rae, and does not say connected to RH
    • Now cannot connect via https:192.168.1.66:9010 (pinging says host down).
    • robothub-ctl status shows Agent is not running! I tried restarting the service but that failed. with robothub-ctl logs showing errors including "user/agent : failed to initialize context"
    • I give up - for now

    So at this point, I tried to manually upload the ros2 docker image to rae and run locally, which is why I would like a persistent IP in my LAN

      mjohannessen That is behavior I have not encountered so far (especially upgrading part) - it is obviously unexpected. Can you share what firmware version you are using (I am guessing 1.12? you can check via cat /etc/os-release) and I will try to figure out where it is going wrong. Again - sorry for issues you are facing.

      Also do you mind showing me what the RH site is upgrading to if you have access to that information still (which version)?

      I'm still not able to connect to RH and will try this again from a hard reset, but before doing that here is some info:

      cat /etc/os-release
      ID=luxonisos
      NAME="Luxonis OS"
      VERSION="1.14"
      VERSION_ID=1.14
      PRETTY_NAME="Luxonis OS 1.14"
      DISTRO_CODENAME="dunfell"
      IMAGE_REV=e57c058e3040838683b42e6ce59a2816d2332aa3
      BUILD_ID="20231206224801"

      Also

      `robothub-ctl status
      ╔════════════════════════════════════════════════════════════════════════════╗
      ║ ║
      ║ RobotHub Agent (23.340.1249 | keembay/arm64 Version 1.14 | DepthAI 2.19.1) ║
      ║ ║
      ╚════════════════════════════════════════════════════════════════════════════╝

      Web UI https://localhost:9010
      DepthAI 2.19.1

      Connected to cloud? no (https://robothub.luxonis.com)
      Pending detections 0
      `

      and

      robothub-ctl logs
      313 11:04:38 W user/agent/hub-connection : callHome failed!
      {
      "error": {
      "cause": {
      "cause": {
      "code": "EAI_AGAIN",
      "errno": -3001,
      "hostname": "robothub.luxonis.com",
      "message": "getaddrinfo EAI_AGAIN robothub.luxonis.com",
      "name": "Error",
      "stack": "Error: getaddrinfo EAI_AGAIN robothub.luxonis.com\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)",
      "syscall": "getaddrinfo"
      },
      "message": "fetch failed",
      "name": "TypeError",
      "stack": "TypeError: fetch failed\n at Object.fetch (node:internal/deps/undici/undici:11457:11)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async RobotHubHttpClient.request (file:///usr/libexec/robothub/robothub-agent.mjs:187887:23)\n at async Object.callHome (file:///usr/libexec/robothub/robothub-agent.mjs:188228:22)\n at async ensureCallingHome (file:///usr/libexec/robothub/robothub-agent.mjs:158730:28)\n at async Object.ensureCallingHome (file:///usr/libexec/robothub/robothub-agent.mjs:156991:9)\n at async Promise.all (index 0)\n at async file:///usr/libexec/robothub/robothub-agent.mjs:234107:11"
      },
      "message": "failed to obtain auth code",
      "name": "Error",
      "stack": "Error: failed to obtain auth code\n at Object.callHome (file:///usr/libexec/robothub/robothub-agent.mjs:188255:17)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async ensureCallingHome (file:///usr/libexec/robothub/robothub-agent.mjs:158730:28)\n at async Object.ensureCallingHome (file:///usr/libexec/robothub/robothub-agent.mjs:156991:9)\n at async Promise.all (index 0)\n at async file:///usr/libexec/robothub/robothub-agent.mjs:234107:11"
      }
      }
      313 11:04:38 I user/agent/hub-connection : waiting 23004 milliseconds
      313 11:05:01 I user/agent/hub-connection :
      313 11:05:01 I user/agent/hub/config : calling home (expectedTeamId = null)
      313 11:05:01 I user/agent/hub/config : calling home -> first time, need to authorize
      313 11:05:01 W user/agent/hub-connection : callHome failed!

      So this looks like a comm issue, so then I went through the wifi setup per https://docs-beta.luxonis.com/hardware/rae/get-started?v=Advanced+%28manual%29 (notes: the psk=<long generated key> should not be in quotes as the instructions indicate and I had to enter 'wpa_supplicant -B -i wlp1s0 -c /etc/wpa_supplicant.conf' twice which has been previously reported).

      I can connect to the outside:

      root@rae:/# ping apple.com
      PING apple.com (17.253.144.10): 56 data bytes
      64 bytes from 17.253.144.10: seq=0 ttl=56 time=14.667 ms
      64 bytes from 17.253.144.10: seq=1 ttl=56 time=15.297 ms

      Still - robothub-ctl status showed " Connected to cloud? no (https://robothub.luxonis.com)"

      I ended up downgrading the firmware to 1.12 per https://discuss.luxonis.com/d/2328-newbee-quick-starter-to-get-code/4 and am using the luxonis/rae-ros-robot:humble image (built on a Mac and scp'ed to rae).

      Honestly, I think the rae is great, but don't see the value yet of a robothub connection, especially for people who want to keep everything local and considering the issues in connecting to and using robothub. It seems using the local docker approach and using VSCode with the docker extension is the way to go. Time might be better spent getting documents together for using SLAM and some of the other functions, beefing up the local http view/control service, and pushing out interesting tutorials to show what this device can do.

      My 2¢