Python Forum
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.

[Image: yXiCWOP]

Any advice or assistance would be greatly appreciated.

Thanks

BMC
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pyserial/serial "has no attribute 'Serial' " gowb0w 9 3,877 Aug-24-2023, 07:56 AM
Last Post: gowb0w
  Search Results Web results Printing the number of days in a given month and year afefDXCTN 1 2,229 Aug-21-2020, 12:20 PM
Last Post: DeaD_EyE
  How to append one function1 results to function2 results SriRajesh 5 3,134 Jan-02-2020, 12:11 PM
Last Post: Killertjuh

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020