Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post serial results
#1
Hello

I am new to Python but have found code that does what I need to an extent.

I have a scale with an rs232 out. I have modified the python code to my scales config and it now delivers the scale output to the terminal window on my raspberry pi when I click the print button on the scale.

I also have a barcode scanner attached which writes the barcode to the terminal window.

#!/usr/bin/env python3
import time
import serial

ser = serial.Serial(
 port='/dev/ttyUSB0',
 baudrate = 2400,
 parity=serial.PARITY_EVEN,
 stopbits=serial.STOPBITS_ONE,
 bytesize=serial.SEVENBITS,
 timeout=None
)

while 1:
 x=ser.readline()
 print(x)
How can I send the print output to a url? Ideally I would like it to be written back to my database via a url but even if it could be written to a local database, that would be helpful.

The other aspect that I can seem to get is line above the scale reading, which is inserted from the barcode reader.

İmage


Any advice or assistance would be greatly appreciated.

Thanks

BMC
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Dictionary Results Error prophet11 2 71 Apr-21-2019, 11:22 PM
Last Post: prophet11
  How can I only receive data from selected serial numbers MasterCATZ 7 127 Apr-20-2019, 08:35 AM
Last Post: MasterCATZ
  Multiple process access to a serial port mkonnov 0 34 Apr-14-2019, 12:42 PM
Last Post: mkonnov
  Trouble writing over serial EngineerNeil 1 90 Apr-07-2019, 08:17 PM
Last Post: j.crater
  Serial communication with raspberry pi 3B and Xbee kj7 0 97 Mar-25-2019, 03:39 AM
Last Post: kj7
  Can't log in with requests post LilDog 2 587 Mar-11-2019, 08:16 AM
Last Post: yourv3nom
  Serial USB problem DPaul 3 223 Feb-21-2019, 02:18 PM
Last Post: Larz60+
  Hex and serial variable deal0703 8 277 Feb-17-2019, 09:48 PM
Last Post: deal0703
  Serial Communication Error AlphyOuseph 1 172 Feb-07-2019, 07:16 AM
Last Post: DeaD_EyE
  Writing commands to serial python_beginner 7 13,230 Feb-03-2019, 09:03 AM
Last Post: jambuna35

Forum Jump:


Users browsing this thread: 1 Guest(s)