Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Zerin

Members
  • Benutzer seit

  • Letzter Besuch

  1. Thank you :) I will try "Restart=always" as you suggested
  2. Hello, I want to run a python script 24/7. I am using systemd service and it looks like this: [Unit] Description= start code After=multi-user.target [Service] Type=simple ExecStart= /usr/bin/python3 /home/pi3/code1.py Restart=on-abort [Install] WantedBy=multi-user.target When I enabled the systemd service it was running without error. but after few hours it stopped. I got the following error. ● codestart.service - start code Loaded: loaded (/lib/systemd/system/codestart.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2022-06-07 16:13:15 CEST; 20h ago Process: 859 ExecStart=/usr/bin/python3 /home/pi3/code1.py (code=exited, status=1/FAILURE) Main PID: 859 (code=exited, status=1/FAILURE) CPU: 1.086s Jun 07 16:13:15 raspberrypi python3[859]: File "/home/pi3/code1.py", line 54, in main Jun 07 16:13:15 raspberrypi python3[859]: ipcon.connect(HOST, PORT) Jun 07 16:13:15 raspberrypi python3[859]: File "/usr/local/lib/python3.9/dist-packages/tinkerforge/ip_connection.py", lin> Jun 07 16:13:15 raspberrypi python3[859]: self.connect_unlocked(False) Jun 07 16:13:15 raspberrypi python3[859]: File "/usr/local/lib/python3.9/dist-packages/tinkerforge/ip_connection.py", lin> Jun 07 16:13:15 raspberrypi python3[859]: tmp.connect((self.host, self.port)) Jun 07 16:13:15 raspberrypi python3[859]: OSError: [Errno 101] Network is unreachable Jun 07 16:13:15 raspberrypi systemd[1]: codestart.service: Main process exited, code=exited, status=1/FAILURE Jun 07 16:13:15 raspberrypi systemd[1]: codestart.service: Failed with result 'exit-code'. Jun 07 16:13:15 raspberrypi systemd[1]: codestart.service: Consumed 1.086s CPU time. ~ Can you please suggest what should I do to restart the code in case of network failure? Thanks
  3. Hallo, Ich versuche, die Sensordaten alle 10 Sekunden abzurufen und in einer CSV-Datei zu speichern. Ich brauche kontinuierliche Daten. Aber ich erhalte einen Fehler. Den Code habe ich angehängt HOST = "192.168.0.104" PORT = 4223 UID_tem = "Nwv" # Change XYZ to the UID of your Temperature Bricklet 2.0 import csv from tinkerforge.ip_connection import IPConnection def cb_temperature(temperature): print("Temperature: " + str(temperature/100.0) + " °C") output1.writerow([str(temperature/100.0)]) if __name__ == "__main__": ipcon = IPConnection() # Create IP connection t = BrickletTemperatureV2(UID_tem, ipcon) # Create device object ipcon.connect(HOST, PORT) # Connect to brickd t.set_temperature_callback_configuration(1000, False, "x", 0, 0) csvfile1= open ('/home/pi/temp1_data.csv','wb') output1 = csv.writer(csvfile1,delimiter=';', quotechar='|') output1.writerow(['temperature']) t.register_callback(t.CALLBACK_TEMPERATURE, cb_temperature) csvfile1.close() input("Press key to exit\n") # Use raw_input() in Python 2 ipcon.disconnect() Ich erhalte den folgenden Fehler: Exception in thread Callback-Processor: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/home/pi/.local/lib/python3.9/site-packages/tinkerforge/ip_connection.py", line 1239, in callback_loop self.dispatch_packet(data) File "/home/pi/.local/lib/python3.9/site-packages/tinkerforge/ip_connection.py", line 1219, in dispatch_packet cb(unpack_payload(payload, form)) File "/home/pi/Desktop/testtempcsv.py", line 23, in cb_temperature output1.writerow([str(temperature/100.0)]) ValueError: I/O operation on closed file. Kann mir jemand freundlicherweise sagen, wie ich das beheben kann? Danke :)

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.