Python error

  • Hi,

    I have been trying to following the documentation here:

    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/", line 3, in <module>
    pstat = Potentiostat('/dev/cu.usbmodem3649831')
    File "/Users/guest/anaconda2/lib/python2.7/site-packages/potentiostat/", line 111, in __ init __
    self.hw_variant = self.get_hardware_variant()
    File "/Users/guest/anaconda2/lib/python2.7/site-packages/potentiostat/", line 120, in get_hardware_variant
    msg_dict = self.send_cmd(cmd_dict)
    File "/Users/guest/anaconda2/lib/python2.7/site-packages/potentiostat/", line 407, in send_cmd
    msg_dict = json.loads(msg_json.decode())
    File "/Users/guest/anaconda2/lib/python2.7/json/__ init", line 339, in loads
    return _default_decoder.decode(s)
    File "/Users/guest/anaconda2/lib/python2.7/json/", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "/Users/guest/anaconda2/lib/python2.7/json/", 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