Jump to content

IO16 direction-mask 236


theo

Recommended Posts

Hi,

 

was mache ich falsch, ich bekomme immer direction-mask=236?

 

Es scheint nicht am shell-Binding zu liegen, ich konnte es mit einem simplen python und ruby Skript nachvollziehen.

 

root@proliant:~# tinkerforge call io16-bricklet efY set-port-configuration a 0b11111111 o false

root@proliant:~# tinkerforge call io16-bricklet efY get-port-configuration a

direction-mask=236

value-mask=0

root@proliant:~# tinkerforge call io16-bricklet efY set-port-configuration a 0b00001100 o true

root@proliant:~# tinkerforge call io16-bricklet efY get-port-configuration a

direction-mask=236

value-mask=12

root@proliant:~# tinkerforge call io16-bricklet efY set-port-configuration a 0b11110011 i true

root@proliant:~# tinkerforge call io16-bricklet efY get-port-configuration a

direction-mask=236

value-mask=255

root@proliant:~# tinkerforge call io16-bricklet efY set-port-configuration a 0b11111111 o true

root@proliant:~# tinkerforge call io16-bricklet efY get-port-configuration a

direction-mask=236

value-mask=255

root@proliant:~# tinkerforge call io16-bricklet efY get-port-configuration a

direction-mask=236

value-mask=255

root@proliant:~# tinkerforge call io16-bricklet efY set-port-configuration a 0b11110011 i false

root@proliant:~# tinkerforge call io16-bricklet efY get-port-configuration a

direction-mask=236

value-mask=12

 

Gruß,

Theo

 

Link zu diesem Kommentar
Share on other sites

Huch. Ich klinke mich mal mit ein.

Hab das gleiche Problem unter C++.

Ich kann die Portconfiguration nicht setzen.

Im Brick Viewer funktioniert alles.

Im Programm nicht.

 

void Create_IO16(const char* device_uid, uint8_t device_identifier, const char *connected_uid,char position, bool is_new)
{
        /****************************************************************************/
        /*							IO-16 Bricklet einbinden						*/
        /****************************************************************************/
        UID = strdup(device_uid);
        if(UID)
        {
            /****************************************************************************/
            /*							IO-16 Bricklet erstellen						*/
            /****************************************************************************/
            if(!Io16_Brick)
            {
                Io16_Brick = new IO16();
            }
            io16_create(Io16_Brick, device_uid,ipcon);

            /****************************************************************************/
            /*				IO-16 Bricklet zur IP Connection hinzufügen					*/
            /****************************************************************************/
                window->Set_Connectionstatus(true,IO16_BRICKLET,device_uid);
                /****************************************************************************/
                /*					Ausgabegeschwindigkeit einstellen in ms					*/
                /****************************************************************************/
    //			printf("Periode %d\n",Periode);
                io16_set_debounce_period(Io16_Brick, 100);
                /****************************************************************************/
                /*					Temperature Bricklet Callback erstellen					*/
                /****************************************************************************/
                io16_register_callback(Io16_Brick,IO16_CALLBACK_INTERRUPT	, (void*)cb_Io16interrupt,Io16_Brick);
                io16_set_port_configuration(Io16_Brick,"a", 255, IO16_DIRECTION_IN,true);
                io16_set_port_configuration(Io16_Brick,"b", 255, IO16_DIRECTION_IN,true);
                io16_set_port_interrupt(Io16_Brick, 'a', 255);
                io16_set_port_interrupt(Io16_Brick, 'b', 255);

        }
}

Link zu diesem Kommentar
Share on other sites

Hallo photron,

 

danke für die schnelle Reaktion. Das sieht sehr gut aus, das mit der direction-mask funktioniert jetzt wie erwartet!

 

Ich bin gerade beim Testen für das Reconnect Handling im openHAB Binding, dafür habe ich einen Reconnect durch stoppen und starten des brickd simuliert (ich weiß, dass ist nicht das gleiche mit einer lost connection des wifi, aber einfacher zu testen). Bisher - ich möchte es nicht beschwören - waren nach dem Neustart des brickd die output ports high, wenn sie es vor dem stoppen waren. Jetzt sind alle low.

 

-- Ich habe es gerade noch mal mit der alten Firmware versucht, da scheint das Verhalten auch schon so gewesen zu sein. Trotzdem bin ich mir nicht sicher, ob das so sein sollte? --

 

# tinkerforge call io16-bricklet efY set-port-configuration a 0b11110011 i true

# tinkerforge call io16-bricklet efY set-port-configuration a 0b00001100 o true

# tinkerforge call io16-bricklet efY get-port-configuration a

direction-mask=243

value-mask=255

# /etc/init.d/brickd restart

Restarting Brick Daemon:

Stopped process in pidfile '/var/run/brickd.pid' (pid 5607).

Starting /usr/bin/brickd...

# tinkerforge call io16-bricklet efY get-port-configuration a

direction-mask=243

value-mask=243

 

Gruß,

Theo

Link zu diesem Kommentar
Share on other sites

Kann ich hier nicht reproduzieren. Ein brick Neustart kann/sollte sich nicht auf die Hardware auswirken, da diese das gar nicht mitbekommen kann.

 

Bist du sicher, dass du da nicht noch irgendwas im Hintergrund laufen hast, dass durch einen brickd Neustart (den es mittels Disconnected/Connected Callback mitbekommt) an der IO-16 herumstellt?

Link zu diesem Kommentar
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...