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
  How do you add the results together each time a function is called? Exsul 10 399 Aug-09-2019, 09:18 PM
Last Post: ichabod801
  XARGS - help passing results 3inchpython 1 72 Aug-03-2019, 12:13 PM
Last Post: buran
  retrieving pvalue from statsmodels results Staph 4 133 Jul-18-2019, 03:27 PM
Last Post: Gribouillis
  Serial to telnet using Python Charles_Linquist 2 352 Jun-17-2019, 04:37 PM
Last Post: DeaD_EyE
  Reading mixed ASCII/binary serial input N8UR 1 303 Jun-11-2019, 02:49 PM
Last Post: N8UR
  Outputting results into other program ancient650 1 136 Jun-11-2019, 02:49 PM
Last Post: gontajones
  Reading data from serial port as byte array vlad93 1 765 May-18-2019, 05:26 AM
Last Post: heiner55
  Dictionary Results Error prophet11 2 234 Apr-21-2019, 11:22 PM
Last Post: prophet11
  How can I only receive data from selected serial numbers MasterCATZ 7 339 Apr-20-2019, 08:35 AM
Last Post: MasterCATZ
  Multiple process access to a serial port mkonnov 0 198 Apr-14-2019, 12:42 PM
Last Post: mkonnov

Forum Jump:


Users browsing this thread: 1 Guest(s)