Reading data from a serial to USB seismometer from BASIC
Michael Emerton (483) 136 posts |
Hi guys, My Uncle has purchased a USB mindset seismometer. This usually works on a PC using Java. This is supposed to run on the pi under Java in Raspbian, however we are receiving dropouts in data being received due to the CPU running at 100%. We have a python script which simply reads from the serial port using .read(6). However I think the data is being converted to characters before . Is there a simple way to read the port from BASIC The ADC just appears as a serial device under Linux. cheers Michael |
Colin (478) 2433 posts |
I’d be surprised if the dropouts were caused by the CPU running 100% a quick look around the mindset website I found this
So what you are receiving looks correct. The fastest transfer rate required is the number of characters in ‘-32768\r\n’ * 80SPS which is 640 bytes/sec which can be transferred at a slow 9600 baud. I’m surprised any serial terminal would have trouble at that speed. You should be able to get this working properly under raspian – is there a way to increase the size of the serial port buffer? Regarding using it on riscos that would depend on which usb chip is used by the serial port. If it’s a ftdi device I think we have serial drivers for that. What does *usbdevices say? |
Michael Emerton (483) 136 posts |
Hi Colin, Thanks for the advice there, I can confirm that what we found (and you) is that it does indeed send a string line. Annoyingly the advice my Uncle sought on another forum led us down a blind ally! sadly I am now back home and unable to run the * command, but it looks as if the device is incorrectly returning -32 (x1) whereas it should be returning 0 without the actual seismometer connected to the ADC. When I am in contact with it again, I will post back here… Cheers! |
Steve Pampling (1551) 8170 posts |
Are you sure it goes to the centre point value when the sensor is removed? |
Michael Emerton (483) 136 posts |
Talking with my Dad, this is most likely what is happening. The facts I was given came from various sources across different forums (12 bit number packed to 16 bits, it should read 0 with open terminals ect.). As the device outputs ASCII, I am receiving the correct value, ho hum, I guess it needs it’s seismometer partner to solve this question. Sadly whilst on the Pi (no idea about Pi2), lxde appears to be causing the drop-outs in data (USB device disconnection), booting the device to command prompt allows python to operate as expected and return data, however the Java application fails to start (as there is no desktop environment for it). I had hoped to jump in and say “Ah but RISC OS can read it and show a nice graph” but ran out of holiday. Doh! |
Steve Pampling (1551) 8170 posts |
Two input connections or three? I have this feeling dad may have the right bits around. |