I am new at Raspberry and Python, so I will be very glad if you help me at my problem. I need to read some data from weight scale when button on scale is pressed. When I connected this scale via USB on PC, I saw that it works as HID. When I pressed the button, data were written in some text document for example. So, now I am going to connect this scale on Raspberry Pi to read and manipulate with data. Can you give me some example, advice, which library I need to import? I want to write a script, that waits for incomming data and then something do with it. Thanks for help.
Related
Is it possible to recreate the Cronus zen with a Raspberry pi, since the Raspberry pi can send and receive data using Bluetooth id figure it has the power to do that, I’m curious. If it’s possible, how?
I’ve searched google and found a python package that can detect controller buttons on pressed and released but it doesn’t have a send data feature.
This problem is making me crazy! I need to send a CSV file from one raspberry pi to another raspberry pi via bluetooth,
The CSV file will be about max 4MB, I have no problem with changing the language if anyone have a better solution.
By the way, I can't read the csv and send it line by line, I don't need that, I need to send just one file, like a compress file, to process it in the other raspberry.
Thank you very much! I will appreciate any help!
Could you use SCP to copy it over on the command line?
im working on Computer vision (opencv )python and i had a result from the image , so this results is 2D List-arrays that should go to the Arduino by i2c buffer , so i realized that there is a library called smbus that interfacing the Raspberry pi with i2c ports so send and receive data , So i searched on References pages that give me some explanation about this Library but i didn't found eny thing useful...and all what i found is this sites which is not enough information
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/i2c/smbus-protocol
http://wiki.erazor-zone.de/wiki:linux:python:smbus:doc
so im indeed need eny explanation how to send 2D Arrays Like (x,y) Coordinates
from Pi to Arduino with i2c buffer
thanks in advance
Check this repository. We connected a NTC CHIP to a Adafruit Trinket using I2C, but connecting the PI with the an Arduino should be very much the same.
The key file is the I2C.py file, which uses SMBus.
To talk to the Trinket Pro (ATMega328) we used the trinket.py file.
And the corresponding client code in the ATMega328, using the Arduino library, specially the Wire.h is located in the hwthontrinket.ino file.
Finally, you can check how to use the classes in the test files. You basically need to pass the bus number and the address of the device.
I want to access data from devices like RFID reader,CCTV camera which will be connected to a device which has SUSE Linux in it.This is a proprietary device --> Huawei AR515.
But, I am not sure in what format, data will be produced by these devices. If i want to get data, say using Python/C++ what will I have to do?
Help in this regard will be appreciated
In python, maybe this way can helps you
Reading serial data in realtime in Python
In C/C++ for linux platform, you can read directly in /dev/.
In both cases, is mandatory knows whats commands and sequences the device require. In general lines, if you before never try this and you're begginer, the first steps more appropriate are the AT commands.
This can help How to Send/Receive SMS using AT commands?
I may be confusing a few concepts here so any help is appreciated.
Q1: Is it possible to attach any sensor in the world to the USB on my computer as long as it gives me analog data, and read its output? (e.g. pH, temperature, oxygen sensor etc as long as it gives me analog data)
Q2: If so, then what is the simplest way in python for me read such data.
Comment: I am trying to bypass using PLC's, and trying to see if I can get the output from the sensor directly to the PC. (I do not have drivers for these sensors)
Actual Need: I have an oxygen sensor connected to my computer via a USB. The oxygen sensor is able to send out analog data. The obvious way is to go through a PLC. However, I would like a solution which by-passes PLC's so I can connect the sensor directly to my PC via USB.
The USB port on your computer cannot read analog data because USBs work with digital signals. You would need an analog-to-digital converter (ADC).
as #digitaLink answered, it is not possible directly via USB and yes, the obvious way is to use a PLC.
I would go the PLC way - in fact, I did it a few times in the past - and start with an Arduino and later develop a custom PCB, put it in a box and done.
Another possibility is to use a raspberry pi (or similar SBC), which has the GPIOs you can use for analog read.
Edit: there is another possibility.
The sensor you use now is _very_likely_ a PLC in itself, that is, the sensor is attached to a microcontroller that uses the USB port for serial communication. Now, the drivers you are missing do nothing else but decode the data coming through the serial port. Take a look inside your harware and try to find out what components there are in.
So what you could do is to try to find out how to communicate with the sensor via a serial terminal. It is probably possible to monitor serial communication (although I must admit, I don't know how to do that), reverse engineer the code and write your own driver in python. You could learn a lot from this, even if you don't succeed.