Forums

Can't read data from my sensor. Using the nidaqmx library.

Hi Python anywhere.

I am trying to create a script that allows me to read data from a remote location. I am currently using, for that, a National Instruments 9234 with an accelerometer. My script is using dash plotly and nidaqmx. I was following a step by step tutorial , from "Charming data", and so far, the program gets deployed. However, when I click on the button that activates the nidamx part, there are no readings. Previously I was trying as well to deploy this app using Heroku, and it's the same problem; script gets deployed but the button is not working. In Heroku it tells me that the nidaqmx library is not being recognized, here I checked the logs, but I can't find any errors. You have my permission to check out my code.

Where is the script running and where is the sensor connected? How is your script expected to get data from the sensor?

Hi fjl, thanks for answering. I need to add that I am a newb for all this. In the plotlydash app if I run the Vibeasy3.py script located in /home/bayinskiano/Remotemonit3 The script is working on the local host (8050). I would like to be able to read it in the internet page that pythonanywhere is creating. I don't really know if I am going to be able to do this, I guess that one of the computers needs to be the server and the one that I am trying to fetch the data should be the client.

Any suggestions to do this are welcome, and again, thanks for the help.

This is well beyond what we can teach you in our forums. If your sensor is available on your localhost at a specific port, it is very unlikely that that is available on the internet where PythonAnywhere can get to it and your local network configuration is not something that we can help you with.

You could rewrite your local code so that it makes a request to your PythonAnywhere web app to send the data and then the web app can use it however it likes. requests is the most popular Python library for making HTTP requests that you can use.

Thanks Glenn for pointing me in the right direction... I will try to make it work.