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
  Hex and serial variable deal0703 7 92 Feb-14-2019, 09:26 AM
Last Post: deal0703
  Serial Communication Error AlphyOuseph 1 62 Feb-07-2019, 07:16 AM
Last Post: DeaD_EyE
  Writing commands to serial python_beginner 7 9,200 Feb-03-2019, 09:03 AM
Last Post: jambuna35
  assign the variable to every value received serial from Arduino barry76 4 85 Feb-01-2019, 10:19 AM
Last Post: barry76
  Python Read/Write serial dlizimmerman 0 127 Jan-31-2019, 03:12 AM
Last Post: dlizimmerman
  spyder - won't show results in console kbrummert 0 80 Jan-20-2019, 01:11 AM
Last Post: kbrummert
  Reading data from serial port as byte array vlad93 0 171 Jan-08-2019, 08:52 AM
Last Post: vlad93
  Receive Serial Data and store in different Variables in Python jenkins43 5 280 Dec-28-2018, 01:33 PM
Last Post: snippsat
  I need a serial device expert! Caesars_10th 10 344 Dec-18-2018, 10:33 PM
Last Post: jeanMichelBain
  Get Serial ports via Function shift838 1 168 Dec-10-2018, 03:52 AM
Last Post: Alfalfa

Forum Jump:


Users browsing this thread: 1 Guest(s)