RoboHappy
I'm working on a project with my EZ-B v4, and I need some assistance with coding the GetDigital command. My aim is to use pin D22 as an input pin to receive a high/low digital signal from an R/C receiver. The receiver uses a PWM-to-digital output device on one of its channels. This setup will allow me to switch my robot's drive wheels between ARC (automatic mode) and R/C control (manual mode).
The script below is intended to monitor the state of pin D22 and provide verbal feedback. When in Automatic Mode, ARC will control the wheels and all sensors. In manual Mode, a standard radio control transmitter will handle the wheel operations. I need this functionality implemented in both EZ-Script and JavaScript.
Here's my current EZ-Script code:
$X = GetDigital(D22)
if ($X = 0)
$X = "PASS"
EzbSay("in manual Mode")
elseif ($X = 1)
$X = "FAIL"
EzbSay("in Automatic Mode")
endif
Could you review it and help me ensure that it performs correctly? Additionally, guidance on translating this into JavaScript for the ARC environment would be greatly appreciated. Thank you!

Hi Athena,
First off, I do need to keep the EZB in AP mode. The robot will not always be in my home, I intend to show off this robot at different place, which would mean i would want to connect to the internet of the location I am at, while the laptop continues to be connected to the robot.
Im running Windows 11 Pro, version 35H2
The built-in WiFi is a dual band, wireless AC 8265 The WiFi Dongle is a Realtek RTL8188FTV wireless LAN 802.11n
I tried to run the netsh but that is unfamiliar to me.
Static IP's sounds like an idea.
Good - keeping the EZ-B in AP mode is perfectly fine. The static-IP + route approach is the usual reliable fix on a Windows laptop that must keep one WiFi interface connected to the EZ-B AP while using a second WiFi adapter for internet.
Below I’ll give:
Plan summary (what we’ll do)
This keeps the EZ-B reachable at 192.168.1.1 while preserving the Internet route via the dongle/router.
Open an elevated Command Prompt (search cmd, right-click Run as administrator).
Run: netsh interface ipv4 show interfaces
Example commands to set IP & metrics - replace <EZB_IF_NAME> and <INTERNET_IF_NAME> with the exact adapter names from the previous step. If the adapter name contains spaces include it in quotes. Example names often are "WiFi" and "WiFi 2":
Set static IP on EZB adapter (no gateway): netsh interface ipv4 set address name="<EZB_IF_NAME>" static 192.168.1.2 255.255.255.0
Set metrics (internet low metric = higher priority, EZB high metric = lower priority): netsh interface ipv4 set interface name="<INTERNET_IF_NAME>" metric=10 netsh interface ipv4 set interface name="<EZB_IF_NAME>" metric=200
Notes on the route command:
Paste into a Script skill JavaScript tab (edit the skill name if your Pandora skill is named differently):
Notes:
Would you like me to:
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
So, followed the instructions on how correctly fix my wifi dongle to the EZB via the windows GUI. Ran a few test making sure it stayed connected which it did. Usually the disconnects would occur in a short time. Was even able to open up an internet connection, ARC still stayed connected. Next test, powered down this laptop, then powered it back up, with the new settings, the dongle sits and waits for an EZB to appear then connects. I was again able to connect to both EZB and an internet connection, did not lose anything. I also tested the Pandora skill again, it too worked, did not drop. One thing though, that little Pandora Auto-pause script did not work. When I slick start, it displays a small window saying it does not recognize the control command. But I think at this point I may not need it.
Ive been able to switch between manual and automatic with no drops. Occasionally when I manually want to disconnect id forget the auto reconnect script may be running, ARC may get confused (not often) and while I am in automatic mode and I want to disconnect, I get an announcement that im in manual mode from the pc side but im really was in automatic mode. I can then just click EZB_D22 script to start and proper switched setting is announced via the EZB.
So far, generally good.
Nice work - glad the static-IP + route fix cleaned up the network instability. Since things are much better now, here are targeted items to finish off the small annoyances you described (announce mismatch after reconnect, the Pandora ControlCommand error, and having to click Start manually).
I’ll give:
Reminder: put all JavaScript into the Script skill JavaScript tab (not the EZ-Script tab or EZ-Script Console).
Notes about the script:
controlCommand("EZB_D22","ScriptStart")
or, if you prefer the start-and-wait variation:
controlCommand("EZB_D22","ScriptStartWait")
Make sure "EZB_D22" exactly matches the Script skill title (case-sensitive / punctuation). This ensures your monitor will auto-start when the EZ-B connection becomes established.
Test snippet to run (JavaScript):
If that prints "Command ... failed: ...", paste the exact printed error back here and tell me the exact skill title - I’ll help find the correct command to start/stop it.
If you want an automatic internet watcher too Now that your networking is stable you may not need it. But if you want a safety net so PandoraBot stops automatically when internet drops and restarts when it returns, I can post a snappy watcher that uses the exact skill name and attempts ScriptStop/ScriptStart (or whatever command the test above finds).
Small extra tips
If you want, paste the output from the test snippet above or the exact Pandora skill title, and I’ll provide the exact ControlCommand to use or the auto-pause watcher.
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
The new EZB_D22 script does not work. I did paste it as a JS and used correct name in the connection skill. I can click the Start, but it does nothing. So I went back to the previous script, and it that still works, and The Pandora skill still works.
I have not tried the test snippet yet.
For now, I will run some more test.
Thanks - good troubleshooting so far. Since the old script still works and Pandora works, this is likely a Script-skill / JavaScript runtime issue (script not starting, immediate error, or silent exception). Let’s narrow it down with a few quick checks and a small, safe test script so we can see exactly what ARC reports.
First quick checks
Minimal test to verify the Script engine and APIs
What this tells us
Common causes & fixes
If the basic test runs OK I’ll give a simplified, robust monitor next (safe looping, debounce, setVar("$Mode", ...), reliable announce). That monitor will also log prints so if it fails we can see why.
If the test shows an error Paste the printed error text here (from the ARC Status window or the Script skill status region). Also tell me:
Want me to:
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
So I ran the little test script, seems to be ok? This is what it looks like running: Start EZB_D22 test: script started EZB.isConnected(0) => true Digital.get(d22) => true EZB_D22 test: script finished Done (00:00:00.0187201)
Ran the Pandora snippet script, seems to be running. Does seem to be running. If I click it again after it runs, I do get this:
I have this snippet running from the Connection skill (My current init for these test).
controlCommand("HB25 Init", "ScriptStartWait") sleep(500) #wait a bit, or remove if you don't need a delay controlCommand("EZB_D22_ConnMerge", "ScriptStart") controlCommand("PandoraConnect", "ScriptStart")
But the programs all seems to be running, as I sit here, with program running, robot is idle at the moment, is in Automatic mode. I find that I do have to remember what I toggled between my disconnecting, it can then cause ARC to be confused to witch mode it may be in. Alot as improved since my wifi setup was fixed.I have alot more I want to add later (maybe in another thread).
Great - thanks for the detailed update. Nice job getting the static IP/route fix working and stabilizing your WiFi setup. Since the basic JS test shows Digital.get(d22) and EZB.isConnected are working, the next step is to make the D22 monitor robust and predictable so you don't get confusing announcements after reconnects or toggles.
A few quick notes before the code:
Paste this into a Script skill JavaScript tab, save and Start it. Change skillTitle if your Script skill has another name, and adjust ezbIndex or timings if necessary.
Important follow-up / usage tips
If that prints an error, copy the exact printed error text and the exact skill window title so I can map the correct ControlCommand used by that skill. (Remember I cannot view images - paste the text.)
Next steps - what do you want me to do now?
Which would you like next?
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.