No open serial port found on delta stage with Sangaboard V0.2

Hi everyone,

I have built an OpenFlexure Delta Stage microscope with a Sangaboard V0.2.
For the Sangaboard V0.2, I ordered the PCB online and then soldered the circuit components onto the PCB myself. I did not populate the PCB with a USB receptable, nor did I populate the SERIAL_COM, the AUX, the I/O_pins, the 5V and the GROUND slots with any sockets or components.
I then managed to flash the Arduino firmware onto my Arduino nano clone using the old bootloader in the Arduino IDE.
Power supply to the Sangaboard is achieved throught an official Raspberry Pi 4 charger with 5.1V output from which I split off a branch to power the Sangaboard through a barrel jack connector. The Sangaboard is connected to my Raspberry Pi 4 through the same USB cable that I used to flash the firmware onto the Arduino nano.

My problem is, that the stage is not recognised in the Openflexure software.
I also tried to control the stage through the terminal using python.
Importing the Sangaboard library worked fine, but when I try to call “sb = Sangaboard()” the port auto-scan also doesn’t find any open serial port.

Does that sould like a problem with the Sangaboard or rather with any setting in my openflexure setup?
Any help would be highly appreciated and I’d be happy to supply any further details if necessary.

Reto

The symptoms that you have do not sound as though they are linked to anything about the physical board of the Sangaboard. You are unable to connect to the Nano, so whether the motor part is there of not should not make any difference.
I would try removing the Nano from the Sangaboard and re-flashing the firmware. Look closely to be sure that it has loaded without errors. Then try the Openflexure software. The Nano itself is powered by the USB cable from the Pi. You will beed to reboot the Pi to be sure that the Nano is available when the OpenFlexure server starts. I am assuming that you are using the server version 2?

1 Like

In addition to what William said, you can check if the serial port is created at all in /dev/, it would be /dev/ttyACM* or /dev/ttyUSB*, you can check if something new appears there after plugging the Arduino in. If no port is created it’s probably a hardware issue somewhere or the arduino clone is using a weird USB-serial converter chip that the linux version on which OFM is build doesn’t have a driver for (this seems unlikely). You can also try plugging something else in to the same USB port to check there isn’t a problem with the port itself.

If the port appears but the board is not detected you can go back to the Arduino IDE and use the serial monitor to verify that the firmware was correctly flashed (you can send e.g. “version” to try to get a version string if it doesn’t respond immediately when you open the monitor).

1 Like

Dear William,
thank you very much for your help.

I have removed the Sangaboard and re-flashed the arduino firmware. After putting the Sangaboard back into the microscope and rebooting, unfortunately, the stage is still not recognised.
This is the output I got from the Arduino IDE while flashing the firmware:
*avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users\retoc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM5
     Using Programmer              : arduino
     Overriding Baud Rate          : 57600
     AVR Part                      : ATmega328P
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PC2
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
       flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
       lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
       lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : Arduino
     Description     : Arduino
     Hardware Version: 3
     Firmware Version: 4.4
     Vtarget         : 0.3 V
     Varef           : 0.3 V
     Oscillator      : 28.800 kHz
     SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file “C:\Users\retoc\AppData\Local\Temp\arduino_build_303516/Sangaboard.ino.hex”
avrdude: writing flash (10878 bytes):

Writing | ################################################## | 100% 2.36s

avrdude: 10878 bytes of flash written
avrdude: verifying flash memory against C:\Users\retoc\AppData\Local\Temp\arduino_build_303516/Sangaboard.ino.hex:
avrdude: load data flash data from input file C:\Users\retoc\AppData\Local\Temp\arduino_build_303516/Sangaboard.ino.hex:
avrdude: input file C:\Users\retoc\AppData\Local\Temp\arduino_build_303516/Sangaboard.ino.hex contains 10878 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.16s

avrdude: verifying …
avrdude: 10878 bytes of flash verified

avrdude done. Thank you.*

I noticed that it overrode the baud rate to 57600. When I open the serial monitor in Arduino IDE, I first have to change baud rate to 115200 to get a readable output from the serial monitor.

I am using Version 2.11.0 of the OpenFlexure Connect.

Best,
Reto

Dear Filip, thanks a lot for the suggestion.
I did find /dev/ttyACM0 on my Raspberry Pi, when I had the Sangaboard connected and it also disappeared after disconnecting the Sangaboard. I also plugged my USB adapter for the wireless keyboard into the same port I previously used for the Sangaboard and the keyboard worked completely fine.

When I unplug my Arduino nano from the Sangaboard and connect it to my PC, I can communicate with the Arduino nano over the serial monitor, once I set the baud rate to 115200.

Unfortunately, so far the stage is still not recognised in my microscope.
Is there maybe an option to also change baude rate to 115200 in delta stage microscope?

Best,
Reto

I believe it should be using 115200 baud by default. Was there any logging output from when you tried to create the Sangaboard instance? Can you try creating the Sangaboard instance again but explicitly giving it " /dev/ttyACM0" as port (first argument) to see what the logs say?

When I open the Sangaboard instance without specifying the port, it goes into auto-scanning and then returns ‘WARNING:root:No firmware version string was returned.’ three times before it fails and stops.

When I specify the port, I get the following output:

pi@microscope:~ $ python3
Python 3.7.3 (default, Mar 23 2024, 16:12:05) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sangaboard import Sangaboard
>>> sb = Sangaboard('/dev/ttyACM0')
WARNING:root:No firmware version string was returned.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/.local/lib/python3.7/site-packages/sangaboard/sangaboard.py", line 126, in __init__
    ExtensibleSerialInstrument.__init__(self, port, **kwargs)
  File "/home/pi/.local/lib/python3.7/site-packages/sangaboard/extensible_serial_instrument.py", line 86, in __init__
    self.open(port, False)  # Eventually this shouldn't rely on init...
  File "/home/pi/.local/lib/python3.7/site-packages/sangaboard/extensible_serial_instrument.py", line 115, in open
    raise IOError("The instrument doesn't seem to be responding.  Did you specify"