Python error



  • Hi,

    I have been trying to following the documentation here:
    http://stuff.iorodeo.com/docs/potentiostat/getting_started.html

    I only have the following two lines in my code:
    from potentiostat import Potentiostat
    pstat = Potentiostat('/dev/cu.usbmodem3649831')

    The first line runs fine but the second line throws the following error:
    Traceback (most recent call last):
    File "/Users/guest/Documents/Sublime/rodeostat.py", line 3, in <module>
    pstat = Potentiostat('/dev/cu.usbmodem3649831')
    File "/Users/guest/anaconda2/lib/python2.7/site-packages/potentiostat/potentiostat.py", line 111, in __ init __
    self.hw_variant = self.get_hardware_variant()
    File "/Users/guest/anaconda2/lib/python2.7/site-packages/potentiostat/potentiostat.py", line 120, in get_hardware_variant
    msg_dict = self.send_cmd(cmd_dict)
    File "/Users/guest/anaconda2/lib/python2.7/site-packages/potentiostat/potentiostat.py", line 407, in send_cmd
    msg_dict = json.loads(msg_json.decode())
    File "/Users/guest/anaconda2/lib/python2.7/json/__ init __.py", line 339, in loads
    return _default_decoder.decode(s)
    File "/Users/guest/anaconda2/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "/Users/guest/anaconda2/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
    ValueError: No JSON object could be decoded

    I have installed the iorodeo-potentiostat library using pip and am currently using Python 2.7.14 (although Python 3.5.4 gives me the same error as well). Is there something that I am missing?

    Thank you.



  • @austin

    This error means that you are not getting the correct response back from the Rodeostat. Did you at any time re-program the firmware on the Rodeostat? If so make sure that Tools -> optimize is set to "Fast" rather than "Faster" as there is an issue with the ArduinoJson library, used by the firmware, which causes a problem when optimize is set to "Faster".



  • @Will-Dickson

    That did the trick, thank you for the fast response!


Log in to reply