Skip to content

Incorrect implementation varrible assignment. #21

@KrypTik-Jelly

Description

@KrypTik-Jelly

Hello, In the config.py file it is looking for a hostname of "raspberrypi". This does not work if you are using raspberry pi imager because they allow you to change the host name. My fix right now is to use

hostname = os.popen("cat /proc/device-tree/model").read().strip().split(" ")[0]
        
#if os.path.exists('/sys/bus/platform/drivers/gpiomem-bcm2835'):
if hostname == "Raspberry":
    implementation = RaspberryPi()
else:
    implementation = JetsonNano()

I am not sure what the JetsonNano() will return. I doubt it will be Raspberry Pi 5 Model B Rev 1.0.
I am then splitting that string on the space and getting the first returned which is Raspberry. I don't know about the older Pi models. I have other I can test later but at work I only have a 5. At home I have a 4,3b+,zero w, and maybe a zero (if I can find it) that I can test this on.

I am getting other errors after but I am not getting the JetsonNano error any more.
Other Errors:

  File "/home/pi/High-Pricision_AD_HAT/./python/main.py", line 25, in <module>
    if (ADC.ADS1263_init_ADC1('ADS1263_400SPS') == -1):
        ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/pi/High-Pricision_AD_HAT/python/ADS1263.py", line 357, in ADS1263_init_ADC1
    if (config.module_init() != 0):
        ~~~~~~~~~~~~~~~~~~^^
  File "/home/pi/High-Pricision_AD_HAT/python/config.py", line 65, in module_init
    self.GPIO.setup(self.RST_PIN, self.GPIO.OUT)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Cannot determine SOC peripheral base address

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions