yoelk / instrumentino

Instrumentino is an open-source modular graphical user interface framework for controlling Arduino based experimental instruments
GNU General Public License v3.0
137 stars 59 forks source link

arduino does not respond #36

Closed calocedrus closed 8 years ago

calocedrus commented 8 years ago

Hi Yoel,

I have installed intrumentino in an anaconda virtual environment. When i type python and import it, no error is returned. I can open the GUI for the examples, such as container.py. I have also compiled and uploaded successfully controlino to my uno, having properly setup the board and the library to use. But the arduino isn't detected. For example if I do python test_system.py, the GUI opens correctly, I then go to the Comm menu, select arduino, but no port is visible in the dialog box. If I click ok, the message in the GUI is "arduino did not respond". Do you have any idea why this could happen? The arduino can be seen from the arduino IDE. I also can communicate with it via other programs. When I tried it with instrumentino, I made sure no other program is using the port to which the arduino is connected. If that may help, the message I get from the terminal is:

File "/home/ludovic/Programs/Microprocessors/arduino/instrumentino-master/instrumentino/__init__.py", line 144, in OnUpdateControls
    self.UpdateControls(event.data)
  File "/home/ludovic/Programs/Microprocessors/arduino/instrumentino-master/instrumentino/__init__.py", line 169, in UpdateControls
    comp.Enable(cfg.IsCompOnline(comp))
  File "/home/ludovic/Programs/Microprocessors/arduino/instrumentino-master/instrumentino/comp.py", line 236, in Enable
    self.panel.Enable(isEnabled)
  File "/home/ludovic/anaconda3/envs/arduino/lib/python2.7/site-packages/wx-3.0-gtk2/wx/_core.py", line 9971, in Enable
    return _core_.Window_Enable(*args, **kwargs)
TypeError: in method 'Window_Enable', expected argument 2 of type 'bool'

swig/python detected a memory leak of type 'wxPyXmlSubclassFactory *', no destructor found.

I am on a ubuntu 14.04 system. As a side question, do you think the memory leak

memory leak of type 'wxPyXmlSubclassFactory *'

is because I'm on linux?

Ludovic

yoelk commented 8 years ago

Hi Ludovic, Below is a similar message I once got about this issue. The Arduino doesn't show up because of the way I look for the serial ports. I suppose the easiest way would be to copy the Instrumentino source code library to the library where you have your system description file, and then edit it. Look into util.py, in the getSerialPortsList function.

Please tell me if this solved the problem, or if something else was needed. I'll add it to the documentation.

Thanks, Joel


Dear Instrumentino Developer

I am trying out Instrumentino under Ubuntu 14.

I am trying to create the simplest project imaginable - read a temperature sensor.

All was going well - Controlino was set to Arduino Uno, the PDB library was downloaded, and Controlino was uploaded to the Genuino using the Genuino IDE.

The Instrumentino GUI started up.

I hit a problem when trying to make the initial connection to the Genuino through the Comm menu: no ports were presented for selection.

From the code I see that the port names were expected to be of the form /dev/tty.*

This apparently is not the case for Ubuntu - the Arduino IDE gives the port to be /dev/ttyACM0.

I changed /dev/tty.* to /dev/ttyA*. The drop down window now shows the port, and allows me to select it. However, I continue to receive the message:

“Arduino did not respond”, and hence no run button in the Instrumentino GUI.

I do not know if you respond to requests for information,

but in any case, thank you for having read this far

On Tue, Jun 14, 2016 at 6:16 AM, calocedrus notifications@github.com wrote:

Hi Yoel,

I have installed intrumentino in an anaconda virtual environment. When i type python and import it, no error is returned. I can open the GUI for the examples, such as container.py. I have also compiled and uploaded successfully controlino to my uno, having properly setup the board and the library to use. But the arduino isn't detected. For example if I do python test_system.py, the GUI opens correctly, I then go to the Comm menu, select arduino, but no port is visible in the dialog box. If I click ok, the message in the GUI is "arduino did not respond". Do you have any idea why this could happen? The arduino can be seen from the arduino IDE. I also can communicate with it via other programs. When I tried it with instrumentino, I made sure no other program is using the port to which the arduino is connected. If that may help, the message I get from the terminal is:

File "/home/ludovic/Programs/Microprocessors/arduino/instrumentino-master/instrumentino/init.py", line 144, in OnUpdateControls self.UpdateControls(event.data) File "/home/ludovic/Programs/Microprocessors/arduino/instrumentino-master/instrumentino/init.py", line 169, in UpdateControls comp.Enable(cfg.IsCompOnline(comp)) File "/home/ludovic/Programs/Microprocessors/arduino/instrumentino-master/instrumentino/comp.py", line 236, in Enable self.panel.Enable(isEnabled) File "/home/ludovic/anaconda3/envs/arduino/lib/python2.7/site-packages/wx-3.0-gtk2/wx/_core.py", line 9971, in Enable return core.Window_Enable(_args, *_kwargs) TypeError: in method 'Window_Enable', expected argument 2 of type 'bool'

swig/python detected a memory leak of type 'wxPyXmlSubclassFactory *', no destructor found.

I am on a ubuntu 14.04 system. As a side question, do you think the memory leak

memory leak of type 'wxPyXmlSubclassFactory *'

is because I'm on linux?

Ludovic

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yoelk/instrumentino/issues/36, or mute the thread https://github.com/notifications/unsubscribe/AGTaG3ERu6qzr8hZyvbEEJfH4pdq2Br8ks5qLisMgaJpZM4I08m0 .

calocedrus commented 8 years ago

Joel, thank you for the hints. The problem I was mentioning happened on my work computer, where I didn't get the chance yet to further investigate the issue. But as of now I have installed instrumentino on my personal notebook at home (ubuntu 13.04) and have no issue to find arduino when I navigate to the build or the intrumentino folder. However no port is found if I run python test_system.py located in the root directory (intrumentino-master).

It seems that util.py isn't used to locate the port. I renamed it and arduino is still detected. The search for the proper port seem to be made in the init.py, with SerialUtil().getSerialPortsList() in the OnComm function.

yoelk commented 8 years ago

Yes, and SerialUtil().getSerialPortsList() is defined in util.py.

To prevent confusion, you could uninstall instrumentino from your computer (removing it from site-packages folder) so you're sure the instrumentino code being used is that in the same folder where your script is. Makes sense?

On Wed, Jun 15, 2016 at 5:21 PM, calocedrus notifications@github.com wrote:

Joel, thank you for the hints. The problem I was mentioning happened on my work computer, where I didn't get the chance yet to further investigate the issue. But as of now I have installed instrumentino on my personal notebook at home (ubuntu 13.04) and have no issue to find arduino when I navigate to the build or the intrumentino folder. However no port is found if I run python test_system.py located in the root directory (intrumentino-master).

It seems that util.py isn't used to locate the port. I renamed it and arduino is still detected. The search for the proper port seem to be made in the init.py, with SerialUtil().getSerialPortsList() in the OnComm function.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/yoelk/instrumentino/issues/36#issuecomment-226221353, or mute the thread https://github.com/notifications/unsubscribe/AGTaG-oBEX0DGpntx8hNGhUfbuqkX0jxks5qMBhkgaJpZM4I08m0 .

calocedrus commented 8 years ago

Joel, the culprit is indeed the dot after tty in this line in util.py: ports = glob.glob('/dev/tty.*') I changed it to ports = glob.glob('/dev/tty*') and all the ports are properly detected (ports are in the form ttyXXX not tty.XXX)

You wrote:

you could uninstall instrumentino from your computer (removing it from site-packages folder) so you're sure the instrumentino code being used is that in the same folder where your script is.

I'm not sure what you mean there, since uninstalling instrumentino wouldn't allow any program to import it, would it?

yoelk commented 8 years ago

Thanks! I changed the code accordingly.