Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Fipy läuft nicht richtig ohne Atom

    Scheduled Pinned Locked Moved FiPy
    fipyatom
    29 Posts 4 Posters 11.5k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W Offline
      Wolli01
      last edited by Wolli01

      Hallo Leute, ich schreibe hier in Deutsch weil ich es so besser erklären kann.
      Ich habe ein Projekt in Atom geladen und speichere es auf mein Fipy.
      Läuft alles Wunderbar, sobald ich aber das Atom Programm schließe und den Fipy resette, läuft es nicht mehr richtig.
      Starte ich dann wieder die Atom Software fängt es nach kurzer zeit wieder an zu laufen.
      Irgendwo fehlen da wohl Dateien die nicht auf dem Fipy sind.
      Hier der Link zum Projekt:
      https://ruuvitag-ttn.readthedocs.io/en/latest/

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @Wolli01
        last edited by

        @wolli01 Hallo Wolli. Forget Atom & Pymakr. It just adds another layer of bug opportunities.
        Use ftp (on Windows: e.g. filezilla, on Linux: Filezilla, command line ftp, ...) to transfer your file to the device, then you know that they arrives and will stay there. You can use any terminal emulator, like Putty (windows) or screen, minicom, picocom (linux) or telnet to use the REPL prompt.
        If you still want to use Atom as code editor, you can configure Filezilla to load files into Atom, when selected in the FiPy pane of files.
        Beste Grüße, robert--hh

        W M 2 Replies Last reply Reply Quote 0
        • W Offline
          Wolli01 @robert-hh
          last edited by

          @robert-hh Mit FTP habe ich auch schon gemacht, das Ergebniss ist immer das gleiche.
          Schließe ich Atom, läuft das Programm auf dem Fipy nicht mehr. Starte ich Atom, fängt es nach ein paar Sekunden an zu laufen. Es wird irgendwas nicht auf dem Fipy gestartet, was auch immer.
          Bin schon seit 3 Tagen damit beschäftigt woran es liegen kann.
          Die Boot.py ist leer kann das das Problem sein, was muss da rein?

          robert-hhR 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @Wolli01
            last edited by

            @wolli01 AFAIK Atom has a setting affecting reset on open/close. For comparison, use another terminal emulator, like putty. Configure putty not to use flow control.

            W 1 Reply Last reply Reply Quote 0
            • W Offline
              Wolli01 @robert-hh
              last edited by

              @robert-hh könntest du so lieb sein un es mir nochmal in Deutsch per Email schreiben?
              Wolli013@freenet.de
              Danke!

              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @Wolli01
                last edited by

                @wolli01 Es gibt, soweit ich weiss, in Pymakr/Atom eine Einstellung, welche Reset beim Laden etc. kontrolliert. Das könnte die Ursache sein. Ansonsten Pymakr Atom in die Tonne treten und für REPL robuste Software ohne Nebeneffekte verwenden, wie Putty, screen, picocom, ... Bei Putty muss die Einstellung für Flow Control auf None gesetzt werden.
                Ich selber verwende Pymakr Atom oder VSC nicht. Zu viel Ärger.

                W 3 Replies Last reply Reply Quote 0
                • W Offline
                  Wolli01 @robert-hh
                  last edited by

                  @robert-hh Danke vielmals.

                  1 Reply Last reply Reply Quote 0
                  • W Offline
                    Wolli01 @robert-hh
                    last edited by

                    @robert-hh Alles seltsam, egal mit welchem Programm ich arbeite, beende ich z.B. Putty, hört das Programm nach einen Reset auf zu arbeiten, schalte ich putty ein und resette neu, läuft es wieder.
                    Noch Irgendeine Idee?

                    1 Reply Last reply Reply Quote 0
                    • W Offline
                      Wolli01 @robert-hh
                      last edited by robert-hh

                      @robert-hh
                      hier mal die main.py
                      in der boot.py steht nichts drinne

                      import machine
                      import ustruct
                      
                      import pycom
                      import socket
                      import struct
                      import network
                      import time
                      from network import Bluetooth
                      
                      import settings
                      
                      from node import LoRaWANNode
                      from ruuvitag.scanner import RuuviTagScanner
                      
                      
                      
                      
                      #from ruuvitag.scanner import RuuviTagScanner
                      #rts = RuuviTagScanner()
                      #for ruuvitag in rts.find_ruuvitags(timeout=10):
                      #    print(ruuvitag)
                      #from ruuvitag.tracker import RuuviTagTracker
                      #def cb(ruuvitag):
                      #    print(ruuvitag)
                      #rtt = RuuviTagTracker()
                      #rtt.track_ruuvitags(cb)
                      
                      
                      def pack_temp(temp):
                          """Temperature in 0.005 degrees as signed short"""
                          temp_conv = round(round(temp, 2) / 0.005)
                          temp_int16 = ustruct.pack('!h', temp_conv)
                          return temp_int16
                      
                      
                      def pack_hum(hum):
                          """Humidity in 0.0025 percent as unsigned short"""
                          hum_conv = round(round(hum, 2) / 0.0025)
                          hum_int16 = ustruct.pack('!H', hum_conv)
                          return hum_int16
                      
                      
                      payload = b''
                      
                      rts = RuuviTagScanner(settings.RUUVITAGS)
                      print (rts)
                      
                      
                      
                      # get all data and prepare payload
                      print('harvest ruuvitags')
                      for ruuvitag in rts.find_ruuvitags(timeout=settings.TIMEOUT):
                          id_payload = settings.RUUVITAGS.index(ruuvitag.mac.encode())
                          temp_payload = pack_temp(ruuvitag.temperature)
                          hum_payload = pack_hum(ruuvitag.humidity)
                      
                          payload = payload + bytes([id_payload]) + temp_payload + hum_payload
                      
                      
                      #payload = (b'\x00\x11\x8aZ\xd0\x01\x06&y\xe0')
                      
                      print(payload)
                      
                      
                      
                      print('setup lorawan')
                      node = LoRaWANNode(settings.NODE_APP_EUI, settings.NODE_APP_KEY)
                      
                      print('send payload')
                      node.send(payload)
                      
                      print('enter deepsleep for {} ms'.format(settings.NODE_DEEPSLEEP))
                      machine.deepsleep(settings.NODE_DEEPSLEEP)```
                      Insert Code Here
                      
                      robert-hhR 1 Reply Last reply Reply Quote 0
                      • robert-hhR Offline
                        robert-hh @Wolli01
                        last edited by

                        @wolli01 So sieht es aus. main.py läuft durch bis zu letzten Zeile, und dann ist schluss. Anders als bei Arduino wird main.py nicht zyklisch aufgerufen.

                        Note: Translated by www.deepl.com:
                        so it looks. main.py runs through to the last line, and then it's over. Unlike Arduino, main.py is not called cyclically.

                        W 1 Reply Last reply Reply Quote 0
                        • W Offline
                          Wolli01 @robert-hh
                          last edited by

                          @robert-hh And why's it going when I've got Putty going?

                          M 1 Reply Last reply Reply Quote 0
                          • M Offline
                            morpheus @Wolli01
                            last edited by

                            @wolli01
                            Hallo wolli,
                            wie sieht es aus wenn du das deepsleep auskommentierst?

                            W 1 Reply Last reply Reply Quote 0
                            • W Offline
                              Wolli01 @morpheus
                              last edited by

                              @morpheus Dann läuft es einmal un bleibt stehen auch wenn ich Atom oder Putty anhabe.
                              Also, habe ich den fipy mit dem Expansion Board 3.0 über USB an mein Notebook verbunden.
                              Starte Atom und resette den fipy. Es läuft alles wie es soll. Beende ich jetzt aber Atom dann läuft es so lange bis ich
                              das Usb Kabel entferne und es resette. Danach hört es auf zu funktionieren. Auch wenn ich es an der Steckdose anschließe.
                              Stecke ich jetzt wieder das Usb Kabel ins Notebook und starte ich dann wieder Atom ohne was zu ändern, geht es nach kurzer Zeit wieder so wie es soll.

                              robert-hhR 1 Reply Last reply Reply Quote 0
                              • robert-hhR Offline
                                robert-hh @Wolli01
                                last edited by

                                @wolli01 D.h.: Auch wenn das Board z.B. per USB Ladegerät versorgt wird, startet es nicht? Das ist ungewöhnlich. Ich betreibe z.B. so ein LoRaWan-Gateway.
                                Ggf. läuft es nur einmal. Welchen Wert hat settings.NODE_DEEPSLEEP?

                                W 1 Reply Last reply Reply Quote 0
                                • W Offline
                                  Wolli01 @robert-hh
                                  last edited by Wolli01

                                  @robert-hh
                                  NODE_DEEPSLEEP = 60000
                                  Lasse ich es am Notebook, läuft es durchgehend.
                                  Ich kann es auch ständig resetten und es läuft weiter. Ziehe ich das USB Kable ab und stecke es in die Steckdose, dann geht es nur 1 x. Schließe ich es wieder am Notebook an und starte Atom läuft es wieder sonst nicht.

                                  robert-hhR 1 Reply Last reply Reply Quote 0
                                  • W Offline
                                    Wolli01
                                    last edited by

                                    @robert-hh hier mal die Dateien.
                                    0_1543135744460_main.py
                                    0_1543135752861_node.py
                                    0_1543135758658_settings.py

                                    und im Ordner Lib dann den Ordner ruuvitag
                                    0_1543135791253___init__.py
                                    0_1543135804816_scanner.py

                                    robert-hhR 1 Reply Last reply Reply Quote 0
                                    • robert-hhR Offline
                                      robert-hh @Wolli01
                                      last edited by robert-hh

                                      @wolli01 Notebook mit oder ohne Atom aktiv? Wenn ohne, dann das USB-Netzteil überprüfen. FiPy benötigt relativ viel Strom, in Spitzen mehr als 500mA. Auch ein Versuch: P8 auf 3.3v verbinden.

                                      W 1 Reply Last reply Reply Quote 0
                                      • robert-hhR Offline
                                        robert-hh @Wolli01
                                        last edited by

                                        @wolli01 Hängt es überhaupt von diesen Dateien ab? Zeigt ein simples main.py, mit nur kurz einem Blinken der LED und Deepsleep das gleiche phänomen?

                                        1 Reply Last reply Reply Quote 0
                                        • W Offline
                                          Wolli01 @robert-hh
                                          last edited by

                                          @robert-hh Wenn es läuft dann auch ohne Atom am Notebook.
                                          Wenn das Usb mal ab war dann startet es am Notebook nur mit Atom. sonst nur 1 x.

                                          robert-hhR 1 Reply Last reply Reply Quote 0
                                          • robert-hhR Offline
                                            robert-hh @Wolli01
                                            last edited by robert-hh

                                            @wolli01 D.h. die Software kehrt aus deepsleep nicht mehr zurück. Dazu gibt es viele Posts, welche ich aber nicht intensiv verfolgt habe.

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            Pycom on Twitter

                                            Pycom