Jump to content

Recommended Posts

Posted

Hallo Forum,

 

ich möchte zu folgendem Aufbau meiner Wetterstation:

LAN->Raspberry->USB->MasterBrick mit div. Bricklets

noch eine "Außenstelle" hinzufügen:

StepDown Brick->MasterBrick mit div. Bricklets->WiFi Ext.

 

Auf dem Raspberry laufen ein aktuelles Raspian und die aktuellen Versionen von brickv und brickd. Ebenfalls läuft das Beispielprojekt weather_station.py ohne Probleme. Über brickv kann ich über WiFi auf die Außenstelle zugreifen.

 

Jetzt die Python (absoluter) Anfängerfrage:

Wie kann ich in meinem Python Script eine zweite IPconnection für den "Außensensor" hinzuzufügen?

 

Bereits Danke vorab für Eure Mühe und schöne Grüße,

mwcam

 

Sorry, falls ich diesen Punkt im Forum irgendwo ünerlesen habe...

Posted

Ich habe es so gemacht:

 

HOST1 = "localhost"

HOST2 = "192.168.1.20"

 

#------

 

if __name__ == "__main__":

    ipcon1 = IPConnection()

    ipcon1.connect(HOST1, PORT)

    ipcon2 = IPConnection()

    ipcon2.connect(HOST2, PORT)

 

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...