Jump to content

lemmi25

Members
  • Gesamte Inhalte

    3
  • Benutzer seit

  • Letzter Besuch

Letzte Besucher des Profils

Der "Letzte Profil-Besucher"-Block ist deaktiviert und wird anderen Benutzern nicht angezeit.

lemmi25's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter

Recent Badges

0

Reputation in der Community

  1. Hey, thanks for the fast reply. Getting the hex numbers is not my Problem. The character (when I convert the hex numbers) just make no sense. They should be numbers and or normal characters. Here is the datasheet from the sensor. https://www.digikey.de/de/products/detail/gas-sensing-solutions-ltd/EXPLORIR-M-20/9952879
  2. Hi, I am using the TinkerForge RS232 V2 Module and want to read sensor data. This is my code #!/usr/bin/env python # -*- coding: utf-8 -*- # For this example connect the RX1 and TX pin to receive the send message HOST = "localhost" PORT = 4223 UID = "XXXX" # Change XYZ to the UID of your RS232 Bricklet 2.0 from tinkerforge.ip_connection import IPConnection from tinkerforge.bricklet_rs232_v2 import BrickletRS232V2 import time # Callback function for read callback def rs232_data_received(data): test = ''.join(data) print(test) if __name__ == "__main__": ipcon = IPConnection() # Create IP connection rs232 = BrickletRS232V2(UID, ipcon) # Create device object ipcon.connect(HOST, PORT) # Connect to brickd rs232.set_configuration(baudrate=9600, parity=BrickletRS232V2.PARITY_NONE, stopbits=BrickletRS232V2.STOPBITS_1, wordlength=BrickletRS232V2.WORDLENGTH_8, flowcontrol=BrickletRS232V2.FLOWCONTROL_OFF) # Don't use device before ipcon is connected print(rs232.get_chip_temperature()) # Register read callback to function cb_read rs232.register_callback(rs232.CALLBACK_READ, rs232_data_received) # Enable read callback rs232.enable_read_callback() input("Press key to exit\n") # Use raw_input() in Python 2 ipcon.disconnect() The problem is, when I get the data output I only see unusual characters like this: [ ý ¿ ¿ å ë [ ý å ë [ ý When I use a FTDI Chip I can read the correct output (using pyserial). I also attached a LogicAnalyzer and the data shows fine. So I think it is a problem of converting the Data (Baudrate is correct). Since I do not now what in the middle "layer" of TinkerForge is happening with the data, can someone please help me how to convert the data into correct ascii Numbers? Many thanks
×
×
  • Neu erstellen...