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

    Unsure why display won't work with WiPy3.0

    Scheduled Pinned Locked Moved WiPy 2&3
    3 Posts 1 Posters 53 Views 1 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.
    • K Offline
      Karin Layton
      last edited by

      I switched recently from pyboard v1.1 to the WiPy. I have a display ST7735 that was working with the pyboard, but have been unable to get it to work with the new WiPy.

      I have tried using two different libraries:
      https://github.com/AnthonyKNorman/MicroPython_ST7735
      https://github.com/boochow/MicroPython-ST7735
      (modifying both from "low/high" to "value(0/1)" as needed)

      This is my initialization in main:

      from machine import SPI, Pin
      displayres = 'P7'
      displaydc = 'P8'
      displaycs = 'P9'
      displaysck = 'P10'
      displaymiso = 'P14'
      displaymosi = 'P11'
      spi = SPI(0, baudrate=8000000, polarity=0, phase=0)
      d = ST7735.ST7735(spi, rst=displayres, ce=displaycs, dc=displaydc)
      d.reset()
      d.begin()
      d.fill_screen(0x0000)
      

      It isn't returning any error messages but the display is not responding to anything being sent as it did with my pyboard (running this library which uses pyb instead of machine https://github.com/GuyCarver/MicroPython/blob/master/lib/ST7735.py)

      I'm at my wit's end, I can't tell what I'm doing wrong.

      1 Reply Last reply Reply Quote 0
      • K Offline
        Karin Layton
        last edited by

        OK I figured it out, and I'm explaining here just in case anyone else ran into the same error.

        I struggled to get the board originally to connect to wifi. It would say it was connected but didn't? It was like boot was being blown away as soon as it was run. So I finally got the wifi working on this board by moving that code into main, I deleted it out of boot because it seemed stupid and redundant.

        So boot was empty and main had the wifi connect in it, and everything was fine. HOWEVER, there was an error in the display library with an indentation, and although this killed my program, it still connected successfully to wifi but did not send the indent error to pymakr. So there was an error message not being propagated.

        I ended up adding wifi connect back into boot and lo and behold I now get the error message from the display library issue. So now I have the wifi connect in two places and I can't understand why WiPy is the way it is. I really think this deserves a fix in the firmware to stop blowing away boot.

        Here's the wifi code just in case someone wants it:

        from network import WLAN
        import machine
        import pycom
        #WIFI initialization
        wlan = WLAN(mode=WLAN.STA)
        wlan.ifconfig(id=0, config='dhcp')
        wlan.connect(ssid='Main', auth=(WLAN.WPA2, password), hostname='WiPy-1')
        
        while not wlan.isconnected():
            machine.idle()
        print("WiFi connected succesfully")
        print(wlan.ifconfig())
        pycom.heartbeat(False)
        
        1 Reply Last reply Reply Quote 1
        • K Offline
          Karin Layton
          last edited by Karin Layton

          I fixed this:
          "I ended up adding wifi connect back into boot and lo and behold I now get the error message from the display library issue. So now I have the wifi connect in two places and I can't understand why WiPy is the way it is. I really think this deserves a fix in the firmware to stop blowing away boot."

          If you run this once:

          pycom.pybytes_on_boot(False)
          

          it will no longer behave like this.

          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 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom