-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mirobot throws Jason parse error after first command. #2
Comments
*Json error (sorry on phone) |
@janislejins Having a read through the library I spotted this section. One option could be to wrap each call within a try/except block. e.g. from mirobot import Mirobot
def onMirobotError(x, msg, timeout,mirobotInstance):
print x,msg,timeout,mirobotInstance
# Connect to Mirobot
mirobot = Mirobot()
mirobot.autoConnect()
# pass error notifications to the callback above instead of halting execution
mirobot.errorNotify(onMirobotError)
# Move forward 100mm
mirobot.forward(100) bare in mind the above is Python 2 syntax, use |
I also get errors when using this library (And I don't know how to make code pastes like right here?).
This is the programme I'm running: |
@tobiasbp for now, can you try something like this: from time import sleep
from mirobot import Mirobot
def onMirobotError(x, msg, timeout,mirobotInstance):
print x,msg,timeout,mirobotInstance
# Connect to Mirobot
mirobot = Mirobot()
mirobot.autoConnect('Mirobot-d2f5')
# pass error notifications to the callback above instead of halting execution
mirobot.errorNotify(onMirobotError)
# try to move forward 10mm
mirobot.forward(10)
#wait 3s
sleep(3)
#try again
mirobot.forward(10) Hopefully the program won't crash but display the error message instead and maybe work on the following commands ¯_(ツ)_/¯ |
I'm a student at the royal college of art looking to extend the core functionality of Mirobot for a project.
Unfortunately after sending the first command (like mirobot forward, pen down etc) I get a Jason error and the whole process stalls. Is there a work around(?) can post code if required.
The text was updated successfully, but these errors were encountered: