cyton and daisy sending only 0 value data

piotr_spiotr_s Poland
edited December 2024 in Cyton

Hi,
I was placing cytona and daisy in 3d printed box and I start to think I might have damage the boards somehow.
output from my code is now
python3 main2b.py
2024-12-23 23:43:19.165 ( 0.655s) [python3 ] netinterfaces.cpp:91 INFO| netif 'lo' (status: 1, multicast: 0, broadcast: 0)
2024-12-23 23:43:19.165 ( 0.655s) [python3 ] netinterfaces.cpp:91 INFO| netif 'enp3s0' (status: 1, multicast: 4096, broadcast: 2)
2024-12-23 23:43:19.165 ( 0.655s) [python3 ] netinterfaces.cpp:91 INFO| netif 'wlp2s0' (status: 0, multicast: 4096, broadcast: 2)
2024-12-23 23:43:19.165 ( 0.655s) [python3 ] netinterfaces.cpp:91 INFO| netif 'lo' (status: 1, multicast: 0, broadcast: 0)
2024-12-23 23:43:19.165 ( 0.656s) [python3 ] netinterfaces.cpp:91 INFO| netif 'enp3s0' (status: 1, multicast: 4096, broadcast: 2)
2024-12-23 23:43:19.165 ( 0.656s) [python3 ] netinterfaces.cpp:102 INFO| IPv4 addr: c0a832db
2024-12-23 23:43:19.165 ( 0.656s) [python3 ] netinterfaces.cpp:91 INFO| netif 'lo' (status: 1, multicast: 0, broadcast: 0)
2024-12-23 23:43:19.165 ( 0.656s) [python3 ] netinterfaces.cpp:91 INFO| netif 'enp3s0' (status: 1, multicast: 4096, broadcast: 2)
2024-12-23 23:43:19.165 ( 0.656s) [python3 ] netinterfaces.cpp:105 INFO| IPv6 addr: fe80::56ee:75ff:fe3f:737c%enp3s0
2024-12-23 23:43:19.165 ( 0.656s) [python3 ] api_config.cpp:270 INFO| Loaded default config
2024-12-23 23:43:19.165 ( 0.656s) [python3 ] common.cpp:65 INFO| git:6ca188c266c21f7228dc67077303fa6abaf2e8be/branch:refs/tags/v1.16.2/build:Release/compiler:GNU-7.5.0/link:SHARED
Starting stream...
+2.792779 +3.876288 +2.570847 +1.797394 +1.588790 +1.138652 +3.425322 +3.565619 +2.294539 +1.729553 +2.008337 +3.567043 +3.494357 +2.575776 +1.131656 +1.694097
+4.162911 +3.555215 +2.398608 +1.704005 +1.688911 +3.707121 +4.196976 +3.558764 +1.287598 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000
+6.771974 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +6.771975 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000
+6.771975 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +6.771976 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000
+6.771976 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +6.771977 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000
+6.771977 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +6.771978 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000
.... and it continues like that.
Cyton diods are all on: red, blue, green and usb dongle is blue with blinking red while data streaming.
But data with 0 only are coming.
Below code used to work and data were changing while I was touching the pins , so it was measuring and sending ok before.

Any suggestion, advice? 2 months work I put into it and now it seems broken.

my test code here:

from pylsl import StreamInfo, StreamOutlet
import serial
import struct
import time
import numpy as np
from scipy import signal
from datetime import datetime

def main():
    info = StreamInfo('OpenBCI', 'EEG', 16, 125, 'float32', 'openBCI1234')
    outlet = StreamOutlet(info)

    port = '/dev/ttyUSB0'
    ser = serial.Serial(port=port, baudrate=115200, timeout=1)

    print("Starting stream...")
    ser.write(b'v')
    time.sleep(1)
    ser.write(b'b')

    try:
        while True:
            sample_cyton = ser.read(33)
            sample_daisy = ser.read(33)

            if len(sample_cyton) == 33 and len(sample_daisy) == 33:
                data = []

                # Cyton (1-8)
                for i in range(8):
                    start = 2 + (i * 3)
                    value = struct.unpack('>i', b'\0' + sample_cyton[start:start+3])[0]
                    voltage = value * (4.5 / (2**23 - 1))
                    data.append(voltage)

                # Daisy (9-16)
                for i in range(8):
                    start = 2 + (i * 3)
                    value = struct.unpack('>i', b'\0' + sample_daisy[start:start+3])[0]
                    voltage = value * (4.5 / (2**23 - 1))
                    data.append(voltage)

                # Wyświetl dane
                for value in data:
                    print(f"{value:+.6f}  ", end='')
                print()



    except KeyboardInterrupt:
        print("\nStopping...")
        ser.write(b's')
        ser.close()


if __name__ == '__main__':
    main()

Comments

  • I further checked in with command v and ?
    here is output

    Connected to /dev/ttyUSB0 at 115200 baud.

    Sending 'v' command to check firmware version...
    Firmware Version Response:
    OpenBCI V3 8-16 channel
    On Board ADS1299 Device ID: 0x00
    LIS3DH Device ID: 0x00
    Firmware: v3.1.1
    $$$

    Sending '?' command to inspect ADS1299 registers...
    Register Values Response:
    Board ADS Registers
    ADS_ID, 00, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CONFIG1, 01, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CONFIG2, 02, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CONFIG3, 03, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF, 04, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH1SET, 05, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH2SET, 06, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH3SET, 07, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH4SET, 08, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH5SET, 09, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH6SET, 0A, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH7SET, 0B, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH8SET, 0C, 00, 0, 0, 0, 0, 0, 0, 0, 0
    BIAS_SENSP, 0D, 00, 0, 0, 0, 0, 0, 0, 0, 0
    BIAS_SENSN, 0E, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF_SENSP, 0F, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF_SENSN, 10, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF_FLIP, 11, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF_STATP, 12, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF_STATN, 13, 00, 0, 0, 0, 0, 0, 0, 0, 0
    GPIO, 14, 00, 0, 0, 0, 0, 0, 0, 0, 0
    MISC1, 15, 00, 0, 0, 0, 0, 0, 0, 0, 0
    MISC2, 16, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CONFIG4, 17, 00, 0, 0, 0, 0, 0, 0, 0, 0

    LIS3DH Registers
    0x07 00
    0x08 00
    0x09 00
    0x0A 00
    0x0B 00
    0x0C 00
    0x0D 00
    0x0E 00
    0x0F 00

    0x1F 00
    0x20 00
    0x21 00
    0x22 00
    0x23 00
    0x24 00
    0x25 00
    0x26 00
    0x27 00
    0x28 00
    0x29 00
    0x2A 00
    0x2B 00
    0x2C 00
    0x2D 00
    0x2E 00
    0x2F 00
    0x30 00
    0x31 00
    0x32 00
    0x33 00

    0x38 00
    0x39 00
    0x3A 00
    0x3B 00
    0x3C 00
    0x3D 00
    $$$

  • piotr_spiotr_s Poland
    edited December 2024

    So I decided to give a try to write firmware again (3.1.1) following official guide https://docs.openbci.com/Cyton/CytonProgram/
    after ups and downs I managed to load firmware with Arduino IDE, but now my board doesnt recognize commands....

    import serial
    import time
    
    # Serial port configuration
    PORT = '/dev/ttyUSB0'  # Update with your actual port
    BAUD_RATE = 115200
    TIMEOUT = 1  # Timeout for serial communication
    
    def send_command(ser, command, response_length=100):
        """
        Send a command to the OpenBCI board and read the response.
        :param ser: Serial connection object.
        :param command: Command to send (as bytes).
        :param response_length: Number of bytes to read from the response.
        :return: Response string from the board.
        """
        ser.write(command)
        time.sleep(1)  # Allow time for the board to respond
        response = ser.read(response_length).decode('utf-8', errors='ignore')
        return response.strip()
    
    def main():
        try:
            # Open serial connection
            with serial.Serial(PORT, BAUD_RATE, timeout=TIMEOUT) as ser:
                print(f"Connected to {PORT} at {BAUD_RATE} baud.")
    
                # Send 'v' command to get firmware version
                print("\nSending 'v' command to check firmware version...")
                firmware_response = send_command(ser, b'v', 100)
                print("Firmware Version Response:")
                print(firmware_response)
    
                # Send '?' command to inspect ADS1299 registers
                print("\nSending '?' command to inspect ADS1299 registers...")
                register_response = send_command(ser, b'?', 100000)
                print("Register Values Response:")
                print(register_response)
    
        except serial.SerialException as e:
            print(f"Serial exception: {e}")
        except Exception as e:
            print(f"Error: {e}")
    
    if __name__ == "__main__":
        main()
    

    result is
    python3 main2c.py
    Connected to /dev/ttyUSB0 at 115200 baud.

    Sending 'v' command to check firmware version...
    Firmware Version Response:
    Received unknown character: v

    Sending '?' command to inspect ADS1299 registers...
    Register Values Response:
    Received unknown character: ?

  • Hi, there I managed to load firmware 3.1.1 correctly (I had to use windows ) and now I am back to tarting point, so with answer to command ? like that:
    python3 main2c.py
    Connected to /dev/ttyUSB0 at 115200 baud.

    Sending 'v' command to check firmware version...
    Firmware Version Response:
    OpenBCI V3 8-16 channel
    On Board ADS1299 Device ID: 0x00
    LIS3DH Device ID: 0x00
    Firmware: v3.1.2
    $

    Sending '?' command to inspect ADS1299 registers...
    Register Values Response:
    $$
    Board ADS Registers
    ADS_ID, 00, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CONFIG1, 01, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CONFIG2, 02, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CONFIG3, 03, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF, 04, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH1SET, 05, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH2SET, 06, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH3SET, 07, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH4SET, 08, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH5SET, 09, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH6SET, 0A, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH7SET, 0B, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CH8SET, 0C, 00, 0, 0, 0, 0, 0, 0, 0, 0
    BIAS_SENSP, 0D, 00, 0, 0, 0, 0, 0, 0, 0, 0
    BIAS_SENSN, 0E, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF_SENSP, 0F, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF_SENSN, 10, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF_FLIP, 11, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF_STATP, 12, 00, 0, 0, 0, 0, 0, 0, 0, 0
    LOFF_STATN, 13, 00, 0, 0, 0, 0, 0, 0, 0, 0
    GPIO, 14, 00, 0, 0, 0, 0, 0, 0, 0, 0
    MISC1, 15, 00, 0, 0, 0, 0, 0, 0, 0, 0
    MISC2, 16, 00, 0, 0, 0, 0, 0, 0, 0, 0
    CONFIG4, 17, 00, 0, 0, 0, 0, 0, 0, 0, 0

    LIS3DH Registers
    0x07 00
    0x08 00
    0x09 00
    0x0A 00
    0x0B 00
    0x0C 00
    0x0D 00
    0x0E 00
    0x0F 00

    0x1F 00
    0x20 00
    0x21 00
    0x22 00
    0x23 00
    0x24 00
    0x25 00
    0x26 00
    0x27 00
    0x28 00
    0x29 00
    0x2A 00
    0x2B 00
    0x2C 00
    0x2D 00
    0x2E 00
    0x2F 00
    0x30 00
    0x31 00
    0x32 00
    0x33 00

    0x38 00
    0x39 00
    0x3A 00
    0x3B 00
    0x3C 00
    0x3D 00
    $$$

    I think the problem is
    On Board ADS1299 Device ID: 0x00
    LIS3DH Device ID: 0x00

    but don't know how to solve it. Can someone help me to understand that? What has possibly happened?

    cheers,
    Piotr

  • wjcroftwjcroft Mount Shasta, CA

    If you purchased Cyton from OpenBCI and it is not working, send an email to Customer Support: (contact at openbci.com).

    If this is the Chinese clone mentioned on another of your threads, then support cannot help you.

  • Thanks I've already contacted seller from China. Since, this is open source hardware , maybe someone experienced similar issue. I don't expect solution, but maybe a tip what might have happened that I get response ADS1299 Device ID: 0x00

  • wjcroftwjcroft Mount Shasta, CA

    If the LIS and ADS registers are reading out as zeros, it means that the PIC32 microcontroller and those chips are not properly communicating. Something may be shorted or wrong with the SPI bus (MOSI etc lines.) If the Daisy is detachable, try unplugging it. The SPI bus runs between the mainboard and Daisy.

    https://en.wikipedia.org/wiki/Serial_Peripheral_Interface

Sign In or Register to comment.