Jump to content

alexSch

Members
  • Gesamte Inhalte

    12
  • Benutzer seit

  • Letzter Besuch

Posts erstellt von alexSch

  1. We are trying to combine out of the box Tinkerforge bricks/bricklets with custom build bricklets (own specific PCBs with same architecture as Tinkerforge co-processor bricklets). Trying to replicate the Tinkerforge build environment with unmodified firmware code as a start, we ran into some road blocks. 

    Setup

    • MacOS Sonoma 14.2.1 (Win 10.0.19045 also available)

    What we have done already

    1. Checking to Tinkerforge "cookbook" at https://www.tinkerforge.com/en/doc/Tutorials/Tutorial_Build_Environment/Tutorial.html
    2. Installing docker and downloading the Tinkerforge image tinkerforge/build_environment_c:latest
    3. Cloning the relevant Tinkerforge gits into my custom development folder
      • hat-brick
      • bricklib2
      • bootstrapper_xmc
      • brickletboot_xmc
    1. Symlinking the brickletboot_xmc and bootstrapper_xmc into the bricklib2
    2. Symlinking the bricklib2 into hat-brick/software/src

    A) Trying to build from the command line, only using make

    1. Going to hat-brick/software
    2. Executing make Returns error below
    3. Trying to change the the BRICKLIB2_PATH inside the Makefile does not do the trick or at least I do not understand to teach the Makefile the difference between your folder structure and my folder structure.
    Makefile:5: /Users/alex/Library/cmake/makefiles/Makefile_Bricklet_CoMCU.mk: No such file or directory
    make: *** No rule to make target `/Users/alex/Library/cmake/makefiles/Makefile_Bricklet_CoMCU.mk'.  Stop.

    B) Trying to build the official Tinkerforge firmware for the brick-hat with PlatformIO

    1. Trying to build returns a couple of missing C header files (see errors below)
    2. Trying to add the indeed missing header files within the src/bricklib2 folder from internet sources does mostly solve one issue but creates successive errors
     *  Task wird im Ordner Custom tfHAT XMC1100 ausgeführt: platformio run 
    
    Processing xmc1100_boot_kit (platform: infineonxmc; board: xmc1100_boot_kit; framework: arduino)
    -------------------------------------------------------------------------------------------------------------------------------------------------
    Verbose mode can be enabled via `-v, --verbose` option
    CONFIGURATION: https://docs.platformio.org/page/boards/infineonxmc/xmc1100_boot_kit.html
    PLATFORM: Infineon XMC (1.2.0) > XMC1100 Boot Kit
    HARDWARE: XMC1100 32MHz, 16KB RAM, 64KB Flash
    DEBUG: Current (jlink) On-board (jlink)
    PACKAGES: 
     - framework-arduinoxmc @ 1.4.0 
     - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
    LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ off, Compatibility ~ soft
    Found 15 compatible libraries
    Scanning dependencies...
    No dependencies
    Building in release mode
    Compiling .pio/build/xmc1100_boot_kit/src/bricklib2/asf/common/components/memory/sd_mmc/sd_mmc.c.o
    Compiling .pio/build/xmc1100_boot_kit/src/bricklib2/asf/common/utils/interrupt/interrupt_sam_nvic.c.o
    Compiling .pio/build/xmc1100_boot_kit/src/bricklib2/asf/common/utils/stdio/stdio_usb/stdio_usb.c.o
    Compiling .pio/build/xmc1100_boot_kit/src/bricklib2/asf/sam/components/ethernet_phy/ksz8081mnx/ethernet_phy.c.o
    Compiling .pio/build/xmc1100_boot_kit/src/bricklib2/asf/sam/drivers/twi/twi.c.o
    Compiling .pio/build/xmc1100_boot_kit/src/bricklib2/asf/sam0/drivers/sercom/sercom.c.o
    Compiling .pio/build/xmc1100_boot_kit/src/bricklib2/asf/sam0/drivers/system/clock/clock_samd09_d10_d11/clock.c.o
    Compiling .pio/build/xmc1100_boot_kit/src/bricklib2/asf/thirdparty/fatfs/fatfs-r0.12c/src/ff.c.o
    src/bricklib2/asf/sam/components/ethernet_phy/ksz8081mnx/ethernet_phy.c:47:10: fatal error: ethernet_phy.h: No such file or directory
    
    **********************************************************************
    * Looking for ethernet_phy.h dependency? Check our library registry!
    *
    * CLI  > platformio lib search "header:ethernet_phy.h"
    * Web  > https://registry.platformio.org/search?q=header:ethernet_phy.h
    *
    **********************************************************************
    
     #include "ethernet_phy.h"
              ^~~~~~~~~~~~~~~~
    src/bricklib2/asf/sam/drivers/twi/twi.c:47:10: fatal error: twi.h: No such file or directory
    
    *************************************************************
    * Looking for twi.h dependency? Check our library registry!
    *
    * CLI  > platformio lib search "header:twi.h"
    * Web  > https://registry.platformio.org/search?q=header:twi.h
    *
    *************************************************************
    
     #include "twi.h"
              ^~~~~~~
    src/bricklib2/asf/common/utils/stdio/stdio_usb/stdio_usb.c:51:10: fatal error: stdio_usb.h: No such file or directory
    
    *******************************************************************
    * Looking for stdio_usb.h dependency? Check our library registry!
    *
    * CLI  > platformio lib search "header:stdio_usb.h"
    * Web  > https://registry.platformio.org/search?q=header:stdio_usb.h
    *
    *******************************************************************
    
     #include "stdio_usb.h"
              ^~~~~~~~~~~~~
    src/bricklib2/asf/sam0/drivers/sercom/sercom.c:46:10: fatal error: sercom.h: No such file or directory
    
    ****************************************************************
    * Looking for sercom.h dependency? Check our library registry!
    *
    * CLI  > platformio lib search "header:sercom.h"
    * Web  > https://registry.platformio.org/search?q=header:sercom.h
    *
    ****************************************************************
    
     #include "sercom.h"
              ^~~~~~~~~~
    In file included from src/bricklib2/asf/common/utils/interrupt/interrupt_sam_nvic.c:47:0:
    src/bricklib2/asf/common/utils/interrupt/interrupt_sam_nvic.h:50:10: fatal error: compiler.h: No such file or directory
    
    ******************************************************************
    * Looking for compiler.h dependency? Check our library registry!
    *
    * CLI  > platformio lib search "header:compiler.h"
    * Web  > https://registry.platformio.org/search?q=header:compiler.h
    *
    ******************************************************************
    
     #include <compiler.h>
              ^~~~~~~~~~~~
    src/bricklib2/asf/sam0/drivers/system/clock/clock_samd09_d10_d11/clock.c:46:10: fatal error: clock.h: No such file or directory
    
    ***************************************************************
    * Looking for clock.h dependency? Check our library registry!
    *
    * CLI  > platformio lib search "header:clock.h"
    * Web  > https://registry.platformio.org/search?q=header:clock.h
    *
    ***************************************************************
    
     #include <clock.h>
              ^~~~~~~~~
    compilation terminated.
    compilation terminated.
    compilation terminated.
    compilation terminated.
    compilation terminated.
    compilation terminated.
    In file included from src/bricklib2/asf/thirdparty/fatfs/fatfs-r0.12c/src/ff.h:29:0,
                     from src/bricklib2/asf/thirdparty/fatfs/fatfs-r0.12c/src/ff.c:21:
    src/bricklib2/asf/thirdparty/fatfs/fatfs-r0.12c/src/ffconf.h:5:10: fatal error: conf_fatfs.h: No such file or directory
    
    ********************************************************************
    * Looking for conf_fatfs.h dependency? Check our library registry!
    *
    * CLI  > platformio lib search "header:conf_fatfs.h"
    * Web  > https://registry.platformio.org/search?q=header:conf_fatfs.h
    *
    ********************************************************************
    
     #include "conf_fatfs.h"
              ^~~~~~~~~~~~~~
    compilation terminated.
    *** [.pio/build/xmc1100_boot_kit/src/bricklib2/asf/sam/drivers/twi/twi.c.o] Error 1
    *** [.pio/build/xmc1100_boot_kit/src/bricklib2/asf/thirdparty/fatfs/fatfs-r0.12c/src/ff.c.o] Error 1
    *** [.pio/build/xmc1100_boot_kit/src/bricklib2/asf/common/utils/interrupt/interrupt_sam_nvic.c.o] Error 1
    *** [.pio/build/xmc1100_boot_kit/src/bricklib2/asf/sam0/drivers/sercom/sercom.c.o] Error 1
    *** [.pio/build/xmc1100_boot_kit/src/bricklib2/asf/sam/components/ethernet_phy/ksz8081mnx/ethernet_phy.c.o] Error 1
    *** [.pio/build/xmc1100_boot_kit/src/bricklib2/asf/common/utils/stdio/stdio_usb/stdio_usb.c.o] Error 1
    *** [.pio/build/xmc1100_boot_kit/src/bricklib2/asf/sam0/drivers/system/clock/clock_samd09_d10_d11/clock.c.o] Error 1
    src/bricklib2/asf/common/components/memory/sd_mmc/sd_mmc.c:48:10: fatal error: conf_board.h: No such file or directory
    
    ********************************************************************
    * Looking for conf_board.h dependency? Check our library registry!
    *
    * CLI  > platformio lib search "header:conf_board.h"
    * Web  > https://registry.platformio.org/search?q=header:conf_board.h
    *
    ********************************************************************
    
     #include "conf_board.h"
              ^~~~~~~~~~~~~~
    compilation terminated.
    *** [.pio/build/xmc1100_boot_kit/src/bricklib2/asf/common/components/memory/sd_mmc/sd_mmc.c.o] Error 1
    ========================================================== [FAILED] Took 2.24 seconds ==========================================================
    
     *  Der Terminalprozess "platformio 'run'" wurde mit folgendem Exitcode beendet: 1. 
     *  Das Terminal wird von Aufgaben wiederverwendet, drücken Sie zum Schließen eine beliebige Taste. 

     

    Anyone to help with A) or B)?

    Best regards

    Alex

     

  2. Hallo zusammen, 

    heute habe ich das Tinkerforge NPM-Paket (nodeJS) in meiner Software von Version 2.1.31 auf 2.1.32  aktualisiert. Leider kommt es nun während der Callback-Konfiguration zu folgender Fehlermeldung

    "ERROR: ReferenceError: callbackFormats is not defined"

    Dies tritt nach kurzem Test mit folgenden Bricklets auf:

    • Outdoor Weather
    • Temperature 2.0

    Die beiden Scripts, die die Konfiguration bei mir übernehmen, sind unten angefügt.

    Nach Rollback zu Version 2.1.31 läuft alles wieder problemfrei. In der Online-Dokumentation der API habe ich keine Änderung gefunden. Habe ich da eine wichtige Änderung bei der Callback-Konfiguration verpasst?

     

    Viele Grüße

    Sebastian Alexander Schäfer

     

    Temperature 2.0

    const DEBUG_configCallbacksTempV2_1 = false;
    const DEBUG_configCallbacksTempV2_2 = false;
    
    var configCallbacksTempV2 = function(item) {
        DEBUG_configCallbacksTempV2_1 && console.log('configCallbacksTempV2() started for ' + item.UID + ' ...');
    
        const interval = 1 * 60 * 1000; // every 1 min, 60 s/min, 1000 ms/s
    
        completeJSON.session.bricklets.wiredTemp.UID = item.UID; // Save bricklet UID to completeJSON.session
    
        var t = new Tinkerforge.BrickletTemperatureV2(item.UID, ipcon);
    
        // Configure Bricklet
        t.setStatusLEDConfig(0);
        t.setHeaterConfiguration(0);
        t.setTemperatureCallbackConfiguration(interval, false, "x", -100 * 30, +100 * 50);
    
        // Handle Callbacks
        t.on(Tinkerforge.BrickletTemperatureV2.CALLBACK_TEMPERATURE,
          function (temp) {
            DEBUG_configCallbacksTempV2_2 && console.log('Receiving CALLBACK_TEMPERATURE by BrickletTemperatureV2.');
    
            completeJSON.session.bricklets.wiredTemp.act = getToFixed(temp / 100, 1);
    
            // Only launch control loop if wired sensor was chosen in config
            if (completeJSON.config.webApp.userSettings.temp.sensor == 'wired') {
              ctlHeating(completeJSON.session.temp.mode);
            };
    
            DEBUG_configCallbacksTempV2_2 && console.log('BrickletTemperatureV2.CALLBACK_TEMPERATURE: ' + temp/100 + ' °C');
            // logAddRecordEvent('Wired Temp ' + item.UID + ' ausgelesen');
        });
    
        DEBUG_configCallbacksTempV2_2 && console.log('Wired temperature sensor callback initiated: ' + t.DEVICE_DISPLAY_NAME + '.');
    };
    
    if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
      // console.log('Working server side. Exposing function through module.exports')
      module.exports = configCallbacksTempV2;
    } else {
      // console.log('Working client side. Exposing function through window.*')
      window.configCallbacksTempV2 = configCallbacksTempV2;
    };

     

    Outdoor Weather

    const DEBUG_configCallbacksOutdoorWeather_1 = true;
    const DEBUG_configCallbacksOutdoorWeather_2 = true;
    
    var configCallbacksOutdoorWeather = function(item) {
        DEBUG_configCallbacksOutdoorWeather_1 && console.log('configCallbacksOutdoorWeather() started for ' + item.UID + ' ...');
    
        completeJSON.session.bricklets.wirelessTemp.UID = item.UID; // Save bricklet UID to completeJSON.session
    
        var ow = new Tinkerforge.BrickletOutdoorWeather(item.UID, ipcon); // Create device object
    
        // Configure Bricklet
        ow.setStatusLEDConfig(0)
        ow.setSensorCallbackConfiguration(true);
    
        // What do do if callbacks arrive
        ow.on(Tinkerforge.BrickletOutdoorWeather.CALLBACK_SENSOR_DATA,
          function (identifier, temperature, humidity, lastChange) {
              DEBUG_configCallbacksOutdoorWeather_2 && console.log('Receiving CALLBACK_SENSOR_DATA by BrickletOutdoorWeather.')
              // Store current settings to completeJSON.session, whenever there's a callback
              //completeJSON.session.temp.set = parseInt(document.getElementById("slider1").value)
              
              // Check if lastChange is less than 5 s old
              if (lastChange < 10) {
                DEBUG_configCallbacksOutdoorWeather_2 && console.log('BrickletOutdoorWeather sent callback too early. Tossing data this time!')
              } else {
                completeJSON.session.bricklets.wirelessTemp.act = getToFixed(temperature / 10, 1);
                completeJSON.session.bricklets.wirelessTemp.hum = getToFixed(humidity, 0);
    
                // Only launch control loop sensor if wired sensor was chosen in config
                if (completeJSON.config.webApp.userSettings.temp.sensor == 'wireless') {
                  ctlHeating(completeJSON.session.temp.mode);
                };
    
                DEBUG_configCallbacksOutdoorWeather_2 && console.log('BrickletOutdoorWeather.CALLBACK_SENSOR_DATA: ' + temperature/10 + ' °C');
                // logAddRecordEvent('Sensor ' + identifier + '@' + item.UID + ' ausgelesen');
              };
          }
        );
    
        // DEBUG_configCallbacksOutdoorWeather_2 && console.log('Wireless temperature sensor callback initiated: ' + ow.DEVICE_DISPLAY_NAME + '.');
    };
    
    if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
      // console.log('Working server side. Exposing function through module.exports')
      module.exports = configCallbacksOutdoorWeather;
    } else {
      // console.log('Working client side. Exposing function through window.*')
      window.configCallbacksOutdoorWeather = configCallbacksOutdoorWeather;
    }

     

  3. Ich bin auch sehr an Alternativen interessiert. Meine Probleme mit dem TH-6148 sind:

    • Absolute Temperaturabweichung (ca. + 1 °C gegenüber Referenzmessgeräten)
    • Bevorzuge eine kleinere Bauform
    • Ich benötige keine eingebautes Display
    • Hohe Trägheit der Messungen (Delta T ca. 1 K/min > Vermute, das liegt am Gehäuse und der Belüftung des Sensors)
    • Recht hoher Preis für meinen Anwendungsfall

    Gibt es einen spezifizierten Substandard des Outdoor Weather Bricklet, der kompatible alternative Sensoren aufzeigt?

    Alex

     

  4. Gerade habe ich begonnen, mein Projekt vom RED Brick auf einen Raspberry Pi 3B mit HAT Brick umzuziehen. Leider krankt das Vorhaben direkt zu Beginn:

    1. Installationsanleitung https://www.tinkerforge.com/de/doc/Hardware/Bricks/HAT_Brick.html befolgt
    2. Zugriff auf HAT Brick erfolgreich mittels Brick Viewer im WLAN getestet. Mac mit brickv greift über IP und PORT auf Raspberry Pi zu und erlaubt Auslesen und Steuern des HAT Bricks und angeschlossener Bricklets.
    3. "Print Voltage (HTML)" und "Enumerate (HTML)" Beispiele für Java Script per Apache auf dem Raspberry Pi gehostet und gestartet
    4. Beim Zugriff vom Raspberry Pit via "localhost" meldet die Chromium-Konsole beim Port 4223 "WebSocket connection to 'ws://localhost:4223/' failed: Connection closed before receiving handshake response" - tinkerforge.js:57196. Das Textfenster zeigt "Error: 13".
    5. Beim Zugriff vom Raspberry Pit via "localhost" meldet die Chromium-Konsole beim Standard-Port 4280 "WebSocket connection to 'ws://localhost:4280/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED" - tinkerforge.js:57196. Das Textfenster zeigt "Error: 13".
    6. Beim Zugriff auf die gleichen Testseiten vom Mac via WLAN erscheint in der Browser-Konsole von Safari zwar keine Fehlermeldung, aber Das Textfenster zeigt auch "Error: 13".

    Hat jemand einen Rat, ob ich bei meiner Apache- oder wegsacket Konfiguration etwas anpassen muss? 

    VERSIONEN

    • Raspbian 10 buster
    • Tinkerforge.js 2.1.25
    • Apache 2.4.38
  5. Hallo photron... Leider musste ich eine längere Pause im Projekt einlegen. Hier nun mein Code, der die IP connection aufbaut. Ich habe den Fehler inzwischen seltener, aber immer noch sporadisch. Ein Muster erkenne ich bislang nicht...

     

     
    function initiateConnection() {
        return new Promise((resolve, reject) => {
            console.log('initiateConnection started ...');
            htmlProtocolDiagnosis.value += getHumTimeStamp() + ' Starting IP Connection @ ' + htmlMasterBrickHOST.value + ':' + htmlMasterBrickPORT.value + '\n';
    
            var host = configJSON.webApp.userSettings.IP
            var port = parseInt(configJSON.webApp.userSettings.port)
            var timeout = 3000
    
            if(ipcon !== undefined) {
                ipcon.disconnect();
                DEBUG_2 && console.log('ipcon disconnected before reestablishing connection')
            }
    
            ipcon = new Tinkerforge.IPConnection(); // Create IP connection
    
            // Connect to brickd
            ipcon.connect(host, port, 
              function(error) {
                console.log('Error during IP Connection ' + error);
                htmlProtocolDiagnosis.value += getHumTimeStamp() + ' Error ' + error + ' during IP connection '+ '\n';
                reject(new Error('Error during IP Connection ' + error));
              }
            ); 
    
            // Don't use device before ipcon is connected
            ipcon.on(Tinkerforge.IPConnection.CALLBACK_CONNECTED,
                function (connectReason) {
                  
                  // Trigger Enumerate
                  ipcon.enumerate();  
    
                  // Get Connection state
                  console.log('Current ipcon status: ' + ipcon.getConnectionState());
                  htmlProtocolDiagnosis.value += getHumTimeStamp() + ' IP Connection Status ' + ipcon.getConnectionState() + ' @ ' + htmlMasterBrickHOST.value + ':' + htmlMasterBrickPORT.value + '\n';
    
                }
            );
    
            // Register Enumerate Callback
            ipcon.on(Tinkerforge.IPConnection.CALLBACK_ENUMERATE,
                function(uid, connectedUid, position, hardwareVersion, firmwareVersion,
                         deviceIdentifier, enumerationType) {
                  var enumerationTypeEvaluated = function() {
                    if(enumerationType === Tinkerforge.IPConnection.ENUMERATION_TYPE_DISCONNECTED) {
                      return('');
                      }
                    }
                  var deviceIdentifierReadable = getReadableDeviceName(deviceIdentifier, position, uid) 
    
                  var newDevice = 
                    {"UID": uid, 
                    "ConnectedUID": connectedUid, 
                    "Position": position,
                    "HardwareVersion": String(hardwareVersion).replace(/,/g, '.'),
                    "FirmwareVersion": String(firmwareVersion).replace(/,/g, '.'),
                    "DeviceIdentifier": deviceIdentifier,
                    "DeviceIdentifierReadable": deviceIdentifierReadable}
                    
                    modules.push(newDevice);
                  }
            );
    
            // Use devices enumeration results as indicator, if initiateConnection() was successful
            setTimeout( function() {
              if (modules.length >> 0) {
                DEBUG_2 && console.log('initiateConnection() successful')
                htmlProtocolDiagnosis.value += getHumTimeStamp() + ' Received Modules List from MasterBrick' + '\n';
                resolve();
              } else {
                DEBUG_2 && console.log('initiateConnection() not successful')
                htmlProtocolDiagnosis.value += getHumTimeStamp() + ' Did not receive Modules List from MasterBrick' + '\n';
                reject(new Error('Error during modules enumeration'));
              };
            }, timeout); // Give checker 1s time wait for enumeration callbacks to arrive
        })
    };
    

  6. Hallo liebe TinkerUnity,

     

    in meinem Projekt setze ich die WiFi Extension. Diese wählt sich in das heimische WLAN ein. Meine WebApp im Browser (JavaScript) stellt nun aus dem gleichen WLAN eine IPConnection (ipcon) zum MasterBrick her. Ich setze noch keine Verschlüsselung/Handshake ein, sondern verbinde einfach mittels IP-Adresse und Port.

     

    Das klappt nur leider nicht reproduzierbar. Sporadisch, aber gerne auch mal bei fünf Versuchen hintereinander ergibt liefert ipcon.connect() folgende Fehlermeldung:

     

    WebSocket connection to 'ws://192.168.1.3:4280/' failed: Status line contains non-ASCII character

    Übergeordnet wird dann Error Code 13 ausgelöst.

     

    Ich kann den Fehler auf die Line 49756 innerhalb der tinkerforge.js zurückverfolgen. Den dortige Code hilft mir jedoch leider nicht weiter.

     

    Weiß jemand Rat???

     

    Viele Grüße

    Alex

×
×
  • Neu erstellen...