Jump to content

photron

Administrators
  • Gesamte Inhalte

    3.246
  • Benutzer seit

  • Letzter Besuch

  • Tagessiege

    60

Alle erstellten Inhalte von photron

  1. Das Problem ist im Github Repo behoben: https://github.com/Tinkerforge/brickv/tree/e374b595664f3f68004271bc8dd994e213332f9e Dev-Mode wird nur noch verwendet, wenn Dev-Mode überhaupt vorhanden ist.
  2. Ich habe vor einer Weile mal damit begonnen einen Emulator zu programmieren. Das ist allderings längst nicht fertig: https://github.com/Tinkerforge/generators/tree/master/emulator Diese kleine Beispiel kann ein Ambient Light Bricklet 3.0 gut genug emulieren, dass es zu Anzeige des Graphen in Brick Viewer reicht: https://github.com/Tinkerforge/generators/blob/master/emulator/emulate_ambient_light_v3_bricklet.py
  3. There is not my_callback callback, that's why its not called. There is only the CALLBACK_FRAME_STARTED callback. def cb_frame_started(length): print('cb_frame_started', length) ls.register_callback(BrickletLEDStripV2.CALLBACK_FRAME_STARTED, cb_frame_started)
  4. Sorry, da haben wir nicht aufgepasst. Wir geben aktuell Python 3.5 als Mindestversion an, Dev Mode ist aber in Python 3.7 neu. Der Code versucht zu erkennen ob er paketiert oder aus Source läuft und schaltet Dev Mode nur bei Source ein. Du startest brickv vermutlich über main.py und dann wird Dev Mode aktiviert, den Python 3.6 nicht hat. Das kannst du jetzt erstmal auf verschiedene Arten umgehen. Zum Beispiel, leg dir neben die main.py eine Datei namens package_type mit dem Inhalt none. Wir werden das für die nächste Version besser lösen.
  5. Brick Viewer 2.4.23 Allow saving config when Modbus master timeout is changed for RS485 Bricklet Enable Python development mode when running from source Fix socket leak on connect error Add manual y-axis scaling for plot widget Remove all driver files for Windows 7 and earlier Fix calibration dialog title for Compass Bricklet plugin Fix Galileo satellite numbers for GPS Bricklet 3.0 Add support for IPv6 connections Add commandline options to specify host, port and secret Add tab select menu that stays in the top left corner Fix corner cases in IMU Brick(let) plugin untab handling Add manual firmware list update button if auto-search for updates is disabled Downloads: Windows, Linux, macOS
  6. Brick Viewer 2.4.23 RS485 Bricklet Konfiguration kann wieder gespeichert werden, wenn der Modbus Master Timeout geändert wird Bei Ausführung vom Quelltext wird der Python Entwicklermodus aktiviert Socket wird bei Verbindungsfehler korrekt geschlossen Manuelle Y-Achsenskalierung zu Plots hinzugefügt All Windows 7 spezifischen Treiber entfernt Kalibrierungsdialogtitel des Compass Bricklet Plugins korrigiert Galileo Satellitennummern des GPS Bricklet 3.0 korrigiert Unterstürzung für für IPv6 Verbindungen hinzugefügt Kommandozeilenparameter für Host, Port und Secret hinzugefügt Menukopf zur Tab-Auswahl oben links hinzugefügt Behandlung von Sonderfällen un der IMU Brick(let) Plugin Ausklinklogik korrigiert Knöpfe zur manuellen Aktualisierung der Firmware-Listen hinzugefügt im Fall, dass "Auto-Search for Updates" deaktiviert ist Downloads: Windows, Linux, macOS
  7. Will be part of the next brickv release 2.4.23, scheduled for next week.
  8. Das gilt für angeschlossene Bricklets. Die UID eines Bricks ist nicht änderbar.
  9. from tinkerforge.ip_connection import IPConnection from tinkerforge.bricklet_barometer import BrickletBarometer HOST = "192.168.52.55" PORT = 4215 ipcon = IPConnection() devices = {} def cb_air_pressure(uid, air_pressure): print(f"Air Pressure ({uid}): {air_pressure / 1000} hPa") def cb_altitude(uid, altitude): print(f"Altitude ({uid}): {altitude / 100} m") def cb_enumerate(uid, connected_uid, position, hardware_version, firmware_version, device_identifier, enumeration_type): if enumeration_type == IPConnection.ENUMERATION_TYPE_DISCONNECTED: return if device_identifier == BrickletBarometer.DEVICE_IDENTIFIER: device = BrickletBarometer(uid, ipcon) device.register_callback(BrickletBarometer.CALLBACK_AIR_PRESSURE, lambda *args: cb_air_pressure(uid, *args)) device.register_callback(BrickletBarometer.CALLBACK_ALTITUDE, lambda *args: cb_altitude(uid, *args)) device.set_air_pressure_callback_period(1000) device.set_altitude_callback_period(1000) devices[uid] = device def main(): ipcon.register_callback(IPConnection.CALLBACK_ENUMERATE, cb_enumerate) ipcon.connect(HOST, PORT) ipcon.enumerate() input("Press Enter to exit\n") if __name__ == "__main__": main()
  10. Nothing to do with our MQTT bindings. The shell you run the command in replaces !! with the previous command. You need escape !! like this: --broker-password 'mypassword!!'
  11. Der Mesh Gateway Port kann in der aktuellen Brickd Version nicht geschlossen werden. Sorry. Ich nehme das als Feture für die nächste Version mit auf.
  12. I updated the documentation. Thanks for reporting the problem.
  13. Wie ist dein Netzwerk eingerichtet? Fritzbox? DHCP? Statische IP-Adressen?
  14. Kannst du deinen Programmcode zeigen?
  15. How are you creating the DLL? Are you using Visual Studio?
  16. Entschudige die späte Antwort. Du bist der erste der nach IPv6 fragt in der ganzen Zeit. Ich habe den PHP Bindings und Brick Viewer IPv6 Unterstüzung hinzugefügt. Teste bitte ma die angehängten Versionen. tinkerforge_php_bindings_2_1_30_ipv6.zip brickv-2.4.22+snapshot~4bea4fb_all.deb
  17. So you have an old setup that is working and an identical new setup that is not working right. You could try swapping the SD cards between the Raspberry Pis. If the problem moves with the SD card then its a software problem. If the problem doesn't move with the SD card, then it has to be a difference in hardware. You could try swapping the HAT Zero Bricks between the Raspberry Pis. If the problem moves with the HAT Zero Brick then its a problem with the HAT Zero Brick.
  18. This is not possible in a robust way right now. Even if the uC bindings would allow you to call the getter to reset the count in the callback, you could still lose count. The callback doesn't rseet the count, only the getter with reset_counter=true does it. If you want to use the callback ou can emultate a reset in your code by remembering the counter value from the previous callback call and subtract that from the new value.
  19. Die Webservr::on() Methode erwartet jetzt, dass die Rückgabe des request.send() Aufrufs zurückgegeben wird. server.on("/phase_switcher/requested_power_history", HTTP_GET, [this](WebServerRequest request) { if (!initialized) { // ÄNDERNUG HIER return request.send(400, "text/html", "not initialized"); } const size_t buf_size = PHASE_SWITCHER_RING_BUF_SIZE * 6 + 100; char buf[buf_size] = {0}; size_t buf_written = 0; int16_t val; requested_power_history.peek(&val); // Negative values are prefilled, because the ESP was booted less than 48 hours ago. if (val < 0) buf_written += snprintf(buf + buf_written, buf_size - buf_written, "%s", "[null"); else buf_written += snprintf(buf + buf_written, buf_size - buf_written, "[%d", (int)val); for (int i = 1; i < requested_power_history.used() && requested_power_history.peek_offset(&val, i) && buf_written < buf_size; ++i) { // Negative values are prefilled, because the ESP was booted less than 48 hours ago. if (val < 0) buf_written += snprintf(buf + buf_written, buf_size - buf_written, "%s", ",null"); else buf_written += snprintf(buf + buf_written, buf_size - buf_written, ",%d", (int)val); } if (buf_written < buf_size) buf_written += snprintf(buf + buf_written, buf_size - buf_written, "%c", ']'); // ÄNDERNUG HIER return request.send(200, "application/json; charset=utf-8", buf, buf_written); });
  20. Bindings: Go 2.0.14 Fix bool arrays in getters Download: Go
  21. Bindings: Go 2.0.14 Bool-Arrays in Gettern repariert Download: Go
  22. Go bindings 2.0.13 published. Those will just work now, without modification. You can also remove the replace line from your go.mod file again. 100 FPS is too low, you should be able to send 500 FPS and receive 1000 FPS. This example sends about 500 FPS with two CAN Bricklet 2.0 connected to form a CAN bus: #!/usr/bin/env python # -*- coding: utf-8 -*- HOST = "localhost" PORT = 4223 UID1 = "Er1" # Change XYZ to the UID of your CAN Bricklet 2.0 UID2 = "Gj8" # Change XYZ to the UID of your CAN Bricklet 2.0 from tinkerforge.ip_connection import IPConnection from tinkerforge.bricklet_can_v2 import BrickletCANV2 # Callback function for frame read callback def cb_frame_read(frame_type, identifier, data): if frame_type == BrickletCANV2.FRAME_TYPE_STANDARD_DATA: print("Frame Type: Standard Data") elif frame_type == BrickletCANV2.FRAME_TYPE_STANDARD_REMOTE: print("Frame Type: Standard Remote") elif frame_type == BrickletCANV2.FRAME_TYPE_EXTENDED_DATA: print("Frame Type: Extended Data") elif frame_type == BrickletCANV2.FRAME_TYPE_EXTENDED_REMOTE: print("Frame Type: Extended Remote") print("Identifier: " + str(identifier)) print("Data (Length: " + str(len(data)) + "): " + ", ".join(map(str, data[:min(len(data), 8)]))) print("") if __name__ == "__main__": ipcon = IPConnection() # Create IP connection can1 = BrickletCANV2(UID1, ipcon) # Create device object can2 = BrickletCANV2(UID2, ipcon) # Create device object ipcon.connect(HOST, PORT) # Connect to brickd # Don't use device before ipcon is connected # Configure transceiver for loopback mode can1.set_transceiver_configuration(1000000, 625, can1.TRANSCEIVER_MODE_NORMAL) can2.set_transceiver_configuration(1000000, 625, can2.TRANSCEIVER_MODE_NORMAL) # Register frame read callback to function cb_frame_read #can2.register_callback(can2.CALLBACK_FRAME_READ, cb_frame_read) # Enable frame read callback can2.set_frame_read_callback_configuration(True) # Write standard data frame with identifier 1742 and 3 bytes of data import time c = 0 s = time.monotonic() f = 0 while True: time.sleep(0.0001) if not can1.write_frame(can1.FRAME_TYPE_STANDARD_DATA, 1742, [42, 23, 17]): f += 1 if f % 100 == 0: print('fails', f) continue c += 1 if c % 100 == 0: n = time.monotonic() d = n - s #print('c', c, d, d / c, c / d) print('fps', c / d) input("Press key to exit\n") # Use raw_input() in Python 2 can2.set_frame_read_callback_configuration(False) ipcon.disconnect()
  23. Bindings: Go 2.0.13 Fix streaming setter payload length calculation Convert to Go module Download: Go
  24. Bindings: Go 2.0.13 Streaming-Setter-Payload-Längenberechnung korrigiert In Go Module umgeandelt Download: Go
  25. Okay, the Go bindings are not yet adapted to go.mod, but you can do that yourself for now. Unpack the ZIP file to somwhere, doesn't matter where. Run "go mod init github.com/Tinkerforge/go-api-bindings" in the github.com/Tinkerforge/go-api-bindings directory from the unpacked ZIP file. To your go.mod file add a line like this, to tell Go where to find the module locally: replace github.com/Tinkerforge/go-api-bindings => /path/to/your/github.com/Tinkerforge/go-api-bindings
×
×
  • Neu erstellen...