bookmark_borderGetting Started With Vizy And VS Code

I just scooped up a Vizy Camera for a for a robot project I have in progress. Essentially this is a Raspberry Pi 4 with an Arducam camera and a custom power board in a bespoke case. Check the reviews on tomshardware and hackaday for a little more info. My first impressions are mostly positive – it was super easy to get straight into the included examples by following the quick start guide here.

It is also the source of the noise

One negative that is immediately apparent is the cooling fan – it is hideously noisy – at low speeds there is a distracting amount of PWM noise. I quickly replaced this with a Noctua fan and it has made it far more tolerable to have on the desk while I work with it now. The other thing I’m not thrilled with is the documentation: it is quite good for set up and working with the examples; after that it tapers off, this is the best example to follow so far. I’m inexperienced with Raspberry Pi, not a Python expert, and have never worked with computer vision, so didn’t really know where to start. As I write this I have only spent a few hours poking around, but I do have VS Code hooked up so I can explore the scripts on the camera and start fiddling around – I want to share that in case I can help another newbie.

So, the goal is to be able to use VS code to explore and edit python files on the camera remotely from a desktop or laptop. I’m not going to cover using VNC to remotely access the pi desktop, or connecting to the drive over the network since Vizy mentions it here. The things I’m listing basically follow this much better guide.

  1. Naturally the first step is to download and install VS code on your PC if you don’t have it already
  2. Power up the camera and get it onto your network
  3. Open VS code, click on extensions, search for “remote ssh” and install it. It was already installed for me, so you may be able to skip this.
  4. Open the command palette with CTRL+SHIFT+P and start typing “Remote-SSH: Connect current window to host”, then select it
  5. Select “add new SSH host”
  6. If you haven’t changed any settings on the camera, enter “pi@vizy.local” for the connection
  7. Select Linux
  8. Confirm and continue
  9. Next you should be prompted for a password, the default on the camera will be “raspberry”
  10. If everything works, VS Code should connect and will install some stuff on the camera, so just wait a bit
  11. Go back to the extensions menu, you should now see another section (it may be collapsed) named something like “SSH: VIZY.LOCAL – INSTALLED”. We want to add Python and Pylance here. I already had these on my local machine, so they were showing under the SSH section with a blue button that said “Install in SSH: vizy.local”. Click that and wait some more. Adding these extensions will enable linting and all the usual python features for VS Code, and they’ll work remotely.
  12. Now that you are connected, using file->open folder will open a dialogue box, from here you can pick a directory on the camera and open it up. You should be able to use this workspace in the same way as your local machine and do things like this:

bookmark_borderFiber Optic Matrix Display

Here’s where I’ve posted it:

https://github.com/elliotmade/Fiber-Optic-Matrix-Display

https://www.instructables.com/Fiber-Optic-Matrix-Display/

And here are some places it’s been reposted:


https://upmytech.com/big-led-matrix-becomes-tiny-led-matrix-thanks-to-fiber-optics-hackaday/

https://www.raspberrypi.com/news/fibre-optic-pico-matrix-display/

https://www.tomshardware.com/news/raspberry-pi-pi-pico-fiber-optic-display

https://theawesomer.com/fiber-optic-dot-matrix-display/659082/

https://abertoatedemadrugada.com/2022/02/ecra-de-fibra-optica-com-leds.html

https://www.hackster.io/news/constructing-an-rgb-led-matrix-from-fiber-optic-filaments-d234b99254c0

https://www.dailyadvent.com/news/06f7a662699333d33991697a9d7bf9e1-This-Fiber-Optic-DotMatrix-Display-Is-So-Cool-to-Watch

https://www.dailyadvent.com/news/06f7a662699333d33991697a9d7bf9e1-This-Fiber-Optic-DotMatrix-Display-Is-So-Cool-to-Watch

https://elexhere.com/index.php/2022/03/02/fiber-optic-matrix-display/

https://gajethub.com/constructing-an-rgb-led-matrix-from-fiber-optic-filaments/

https://news.mkme.org/?p=24546https://game-news24.com/2022/03/14/raspberry-pi-pico-is-a-digital-display/

https://lariva2018.com/thanks-to-the-optical-fiber-the-large-led-matrix-becomes-a-small-led-matrix/

https://game-news24.com/2022/03/14/raspberry-pi-pico-is-a-digital-display/

Whatever this duplication is:

https://getdigitaltech.com/developing-an-rgb-led-matrix-from-fiber-optic-filaments/

https://venzux.com/large-led-matrix-turns-into-tiny-led-matrix-thanks-to-fiber-optics/

https://desiserialonline.com/setting-up-an-rgb-led-matrix-from-fiber-optic-filaments/

https://itech24.org/establishing-an-rgb-led-matrix-from-fiber-optic-filaments/

In Spanish:

https://abertoatedemadrugada.com/2022/02/ecra-de-fibra-optica-com-leds.html

https://aldianoticiasroldanillo.com/big-led-matrix-becomes-tiny-led-matrix-thanks-to-fiber-optics/

French:

https://arfy.fr/dotclear/index.php?post/2022/03/03/instructables-Fiber-Optic-Matrix-Display

bookmark_borderCircuitpython Button Library

Wrote a library for Circuitpython that tries to do most of what the OneButton Arduino library does. It handles one or more buttons – debouncing, single click, long presses, and holding. Written to be non-blocking so that it plays nice with the rest of your code, and easy to implement with just a couple lines.

Check it out on github: https://github.com/elliotmade/This-Button

bookmark_borderDead Raspberry Pi Pico – or is it?

I’ve been having some fun with the Raspberry Pi Pico and Circuitpython thanks to Mark Hughes and the Teach Me PCB course that he’s putting on at the moment. For whatever reason, I decided it would be cool to iterate on my word clock design. I’m not done yet, but I am making sure to struggle along the way. Here’s a problem I had with the Pico I wanted to share in case someone else does what I did:

TLDR: Don’t pull some? pins high without first configuring them as input or output in your code. Go to fix

This is what I did:

Wire the clock up – 3v to VCC, GND to GND, GP16 to SDA, GP17 to SCL (just like this guy did).

Something like this

Power it back up – immediately windows says there is something wrong with my device.

Symptoms:

  • Windows makes a sad dingle noise and says there is something wrong with the device
  • Device manager shows a device with “device descriptor request failed”
  • Replacing the driver doesn’t help
  • Same problem if you plug the Pico into another computer
  • Your code doesn’t run
  • No serial port (naturally, USB isn’t working)
  • Power up with the BOOTSEL button held down does work, and allows loading UF2 files
  • Re-loading a circuitpython or micropython UF2 doesn’t change the behavior
  • Undoing the wiring doesn’t make the problem go away
  • Flashing the Pico with the Arduino framework and using C++ still works

It was a struggle to troubleshoot (I bricked 4 Picos before I found out how to recover them), although I admit I didn’t read the entire datasheet before embarking on this quest. I narrowed in on the cause by removing variables until I had only the RTC and Pico connected directly with wires. I found:

  • With only GND and VCC connected, there are no issues
  • If you plug the SCL and SDA in while the Pico is running, it is not interrupted, no problem
  • If you boot the Pico with SCL and SDA connected, all the bad things happen
  • Note at this point I have not added any code to configure GP16 and GP17, I am assembling the circuit first

What is the cause?

I noticed that the DS3231 module I’m using pulls SCL and SDA high when it is powered, this seems to be a key part of my problem. Initially I thought the flash was somehow being corrupted, but after making lots of guesses with help from the folks on the TMPCB Discord, on a hunch I tried setting my pins as inputs and bingo, no more problems. This could be correct, or could be a red herring, more important is how to recover.

What I think is happening is that during boot, if you leave these pins undefined and pull them high, it interrupts things after your code has started running but before the USB is initialized. In this state you don’t have a USB disk to update the code with, nor a serial port to figure out what’s up. Even switching to bootloader mode and replacing the Circuitpython UF2 file doesn’t help. It’s possible that this is a code-only problem, but it suspicious that it was reproducible by connecting the GPIOs.

I think this page and the note on line 28 here explain a similar problem, but I am using different pins.

I found a reference to this “nuke” file in a forum post, here’s the description in the FAQ sheet and a link to the file:

Here’s what to do:

  1. Hope that you saved a copy of your code and libraries on your computer (you did, right?)
  2. Download the flash_nuke.uf2 file
  3. Connect the Pico to USB, hold the BOOTSEL switch while doing this to enter bootloader mode
  4. Copy the nuke file to the Pico drive
  5. Pico should reboot into bootloader mode again
  6. Copy the Circuitpython or Micropython or whatever UF2 to the Pico drive
  7. Pico should reboot in the usual mode now, copy your code and libraries
  8. Next time configure the pins before building and powering the circuit
Back in business

Thanks:

These links for clues:

https://nahog.medium.com/raspberry-pi-pico-dead-serial-5f57e622020f

https://forums.raspberrypi.com/viewtopic.php?t=314269

https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/faq-and-troubleshooting

https://forums.adafruit.com/viewtopic.php?f=60&t=174992

https://github.com/adafruit/circuitpython/issues/4034

Wokwi for a screenshot

And to my pals from the TMPCB course for all the ideas.