Scratch not working

54 views
Skip to first unread message

Derek Golding

unread,
Nov 20, 2019, 10:10:19 PM11/20/19
to Vorpal Robotics Forum
Hi all,
Has scratch stopped working? A constant green light on scratch even when the controller is not plugged in on both PC's and laptop.
Controller buttons work ok and can control the hexapod, but no program will work on scratch.
Any ideas?

Derek Golding

unread,
Nov 20, 2019, 10:46:49 PM11/20/19
to Vorpal Robotics Forum
Looking at the console in Chrome, looks like the software is seeing Com1 and assuming it's the Vorpal, but thats on Com4. Tried reinstalling the driver but still does not work.
 
 

vorpalrobotics

unread,
Nov 21, 2019, 12:57:16 PM11/21/19
to Vorpal Robotics Forum
The vorpal gamepad has to be the lowest numbered com port. You can use device manager (if you're on windows) to change the com port numbers to force that to be true.

However, I'm seeing the issue too on my side. Even when the gamepad is the lowest com number, the code seems to go on and find the higher numbered ports anyway. It's supposed to stop when it finds a port it can open, starting at the lowest numbered port.

It is likely that either something changed over at MIT's scratchx website, or something changed on chrome browser.  I have not changed the scratch code in several months and it was definitely working a couple of months ago because I ran a workshop that used it.

I am investigating now.

vorpalrobotics

unread,
Nov 21, 2019, 2:04:01 PM11/21/19
to Vorpal Robotics Forum
Well I've made some progress but looks like this will be occupying me tomorrow when I have more time.

I've gotten it to connect again and added some debugging on my local copy of the extension. It seems like something changed in how devices are opened either on chrome or on scratchx. There is some kind of timing issue. When I add several debug statements all the sudden it starts to work, but it's not consistent. Sometimes switching which USB port the gamepad is plugged into suddenly makes it work.

So I'm going to have to dig into this. Hopefully I can figure it out in the four hours I have blocked out for it tomorrow. I'll post a fix to the public area as soon as I have something that works consistently.

vorpalrobotics

unread,
Nov 22, 2019, 12:35:01 PM11/22/19
to Vorpal Robotics Forum
Okay, I worked on this for a couple hours today and here's what I found:

Sometimes a com port might get into a state where scratchx can't open it. This apparently happened to the original poster as well as myself. This may be related to recent changes either in chrome or over at the scratchx website, I'm not sure.

The solution, which works on the version of Vorpal Scratch currently online (i.e. I did not have to change it) is pretty simple:

NOTE: These steps are for windows. I will be looking into whether this even happens on mac later today.

1) Make sure you have an internet connection (so drivers can download if needed) and turn on your computer volume (so you can hear the little doot doot doot sounds when devices are installed or removed).
2) Open device manager (just type "device manager" in the windows search bar and you'll find it)
3) Scroll down until you see the item "Ports (COM and LPT) and expand that to see all the com ports. 
4) Plug in the gamepad. You should hear the doot doot doot sound and a new COM port should appear.
4) Find the COM port associated with the gamepad. If you're not sure which one it is, unplug the gamepad to see which one dissappears, then plug it back in again and note which new one appears.
5) right click on the com port associated with the gamepad and select UNINSTALL DEVICE. Wait for the com port to dissapear out of the list.
6) Unplug the gamepad. Wait a few seconds. Plug it in again. Wait for windows to reinstall the driver for the arduino nano, usually takes about 30 seconds.

This completely cleared up the issue for me. At first I thought some of my coding changes fixed it, but then I tried using the online version (which has not changed) and it worked there too. I was able to plug, unplug, replug in a different usb port, use the RESET CONNECTION block, over and over again, and it connected 100% of the time and started controlling the robot.

Please let me know if this fixes the problem for you, and I will then document this over on the wiki under the scratch section.

-Steve P.

Derek Golding

unread,
Nov 27, 2019, 9:57:22 PM11/27/19
to Vorpal Robotics Forum
Hi,
Sorry, it doesn't work. Still no control from the webpage, the controller can move the hexapod manually. The light stays green on the webpage even when the controller is removed. Any ideas? 

vorpalrobotics

unread,
Nov 29, 2019, 8:15:47 AM11/29/19
to Vorpal Robotics Forum
Can you confirm that you've renumbered the gamepad COM port to be the lowest numbered port?
Reply all
Reply to author
Forward
0 new messages