russhughes / st7789s3_mpy

MicroPython driver for the TTGO T-Display-S3 st7789 display written in C
Other
56 stars 9 forks source link

How should I run the provided examples? #1

Closed eliliam closed 7 months ago

eliliam commented 1 year ago

I'd love to use this project in a personal project of my own, but I'm having a hard time getting things up and running. So far, I have successfully flashed the firmware on the device and can access a REPL shell, however when I upload all of the files under the clock example and rename clock.py to be main.py on the device, and then run ampy -p /dev/ttyACM0 run main.py I get the following error:

Traceback (most recent call last):
  File "/usr/bin/ampy", line 8, in <module>
    sys.exit(cli())
  File "/home/eli/.local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/eli/.local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/eli/.local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/eli/.local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/eli/.local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/ampy/cli.py", line 338, in run
    output = board_files.run(local_file, not no_output, not no_output)
  File "/usr/lib/python3.10/site-packages/ampy/files.py", line 309, in run
    self._pyboard.execfile(filename, stream_output=True)
  File "/usr/lib/python3.10/site-packages/ampy/pyboard.py", line 285, in execfile
    return self.exec_(pyfile, stream_output=stream_output)
  File "/usr/lib/python3.10/site-packages/ampy/pyboard.py", line 279, in exec_
    raise PyboardError('exception', ret, ret_err)
ampy.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n  File "<stdin>", line 21, in <module>\r\nImportError: no module named \'tft_config\'\r\n')

And here is the output of running ampy -p /dev/ttyACM0 ls --recursive to list all the files on the device:

/OFL.txt
/Pacifico-Regular.ttf
/boot.py
/clock_320x170/nasa01.jpg
/clock_320x170/nasa02.jpg
/clock_320x170/nasa03.jpg
/clock_320x170/nasa04.jpg
/clock_320x170/nasa05.jpg
/clock_320x170/nasa06.jpg
/clock_320x170/nasa07.jpg
/clock_320x170/nasa08.jpg
/clock_320x170/nasa09.jpg
/clock_320x170/nasa10.jpg
/clock_320x170/nasa11.jpg
/clock_320x170/nasa12.jpg
/clock_320x170/nasa13.jpg
/clock_320x170/nasa14.jpg
/clock_320x170/nasa15.jpg
/clock_320x170/nasa16.jpg
/clock_320x170/nasa17.jpg
/clock_320x170/nasa18.jpg
/clock_320x170/nasa19.jpg
/clock_320x170/nasa20.jpg
/clock_320x170/nasa21.jpg
/clock_320x170/nasa22.jpg
/clock_320x170/nasa23.jpg
/clock_320x170/nasa24.jpg
/clock_320x170/nasa25.jpg
/main.py
/pacifico90.py

Am I doing this correctly or is there something I am missing here?

russhughes commented 1 year ago

...ImportError: no module named \'tft_config\'\r\n')

You need a tft_config.py (and probably a tft_buttons.py) file to configure your display. The examples/configs folder has several examples for various devices and displays.

eliliam commented 1 year ago

Ah that would make sense, I'll give that a go here in just a bit and report back. What is the intended way to run these examples? It would help a lot to have a section in the readme that goes over how to run a generic example from the examples folder.