Jump to content

Servelop

Members
  • Posts

    7
  • Joined

  • Last visited

Servelop's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Here it is: Linux wokepi 5.15.61+ #1579 Fri Aug 26 11:08:59 BST 2022 armv6l GNU/Linux
  2. Ah, I think this answers the question. After I installed my Pi a few months ago, I purposefully created a regular user account, which is not "pi"! I am using this account for all my work that doesn't require the superuser. According to the raspberry pi documentation, pi is the superuser (as far as I remember). So in fact when I am doing sudo with the mcc hat, it is not different that running it from the pi account. How shall I add my regular account to the gpio group?
  3. Better, but still hiccups. Here it is what's going on: sudo ./uninstall.sh git pull sudo ./install.sh #no errors! cd ~/daqhats/examples/c/mcc118/single_value_read ./single_value_read Can't open /dev/gpiomem. Can't open /dev/gpiomem. Can't open /dev/gpiomem. Error: A needed resource was not available. Error: An incorrect parameter was passed to the function. sudo ./single_value_read MCC 118 single data value read example Function demonstrated: mcc118_a_in_read Channels: 0 - 3 Options: OPTS_DEFAULT Press 'Enter' to continue Acquiring data ... Press 'Enter' to abort Samples/Channel Channel 0 Channel 1 Channel 2 Channel 3 27 1.62402 V 1.74712 V 1.75211 V 1.75204 V ----------------- Well, at least there are no more issues with i2c and the example runs well with sudo, unlike earlier. Still sudo is needed...
  4. Jeffrey, i tried your suggestions. No changes in the behavior, see below: sudo ./uninstall.sh mv daqhats/ daqhats_old git clone https://github.com/mccdaq/daqhats.git sudo ./install.sh Reading DAQ HAT EEPROMs Expected I2C bus (i2c-3) not found. sudo reboot bin/single_value_read Can't open /dev/gpiomem. Can't open /dev/gpiomem. Can't open /dev/gpiomem. Error: A needed resource was not available. Error: An incorrect parameter was passed to the function. sudo bin/single_value_read MCC 118 single data value read example Function demonstrated: mcc118_a_in_read Channels: 0 - 3 Options: OPTS_DEFAULT Press 'Enter' to continue Acquiring data ... Press 'Enter' to abort Samples/Channel Channel 0 Channel 1 Channel 2 Channel 3 Error: There was a timeout while obtaining a resource lock. #trying my old trick sudo daqhats_read_eeproms Expected I2C bus (i2c-3) not found. sudo daqhats_read_eeproms Reading... Found EEPROM at address 0 Done sudo bin/single_value_read ... Error: There was a timeout while obtaining a resource lock sudo reboot sudo bin/single_value_read MCC 118 single data value read example Function demonstrated: mcc118_a_in_read Channels: 0 - 3 Options: OPTS_DEFAULT Press 'Enter' to continue Acquiring data ... Press 'Enter' to abort Samples/Channel Channel 0 Channel 1 Channel 2 Channel 3 11 1.75180 V 1.75223 V 1.75211 V 1.75204 V #back to the same behavior
  5. Without the root, none of the examples work at all, a bunch of errors are thrown.... OK, i'll make a fresh clone of the repository, reinstall and test. I'll report in a day or two.
  6. Jeffrey, my Pi is "headless" - no GUI, mouse, keyboard :-) Hence I can't follow the steps you suggested. Nevertheless, here are some answers. 1. I do not have any other hats. 2. SPI, I2C are enabled via raspi-config (see config.txt attached). This morning i reproduced the errors after the system being OFF overnight. See below: $ sudo bin/single_value_read MCC 118 single data value read example Function demonstrated: mcc118_a_in_read Channels: 0 - 3 Options: OPTS_DEFAULT Press 'Enter' to continue Acquiring data ... Press 'Enter' to abort Samples/Channel Channel 0 Channel 1 Channel 2 Channel 3 Error: There was a timeout while obtaining a resource lock. $ sudo daqhats_read_eeproms Expected I2C bus (i2c-3) not found. $ sudo daqhats_read_eeproms Reading... Found EEPROM at address 0 Done $ sudo bin/single_value_read MCC 118 single data value read example Function demonstrated: mcc118_a_in_read Channels: 0 - 3 Options: OPTS_DEFAULT Press 'Enter' to continue Acquiring data ... Press 'Enter' to abort Samples/Channel Channel 0 Channel 1 Channel 2 Channel 3 Error: There was a timeout while obtaining a resource lock. $ sudo reboot $ sudo bin/single_value_read [sudo] password for alexpozhitkov: MCC 118 single data value read example Function demonstrated: mcc118_a_in_read Channels: 0 - 3 Options: OPTS_DEFAULT Press 'Enter' to continue Acquiring data ... Press 'Enter' to abort Samples/Channel Channel 0 Channel 1 Channel 2 Channel 3 12 1.75180 V 1.74712 V 1.74700 V 1.74693 V config.txt
  7. Folks, i noticed a strange behavior of the MCC118 with my Pi Zero 2W. Upon installation of the library, it reported "Expected I2C bus (i2c-3) not found." (Note, i2c and spi were enabled with raspi-config.) Trying to run sudo single_value_read resulted in "Error: There was a timeout while obtaining a resource lock". After some experiments, I executed sudo daqhats_read_eeproms, it successfully read the eeprom and subsequent sudo single_value_read produced adequate voltage readings. After turning the Pi (and the hat) off, then turning back on after several days, same problem: sudo single_value_read resulted in "Error: There was a timeout while obtaining a resource lock". Calling sudo daqhats_read_eeproms produced expected results, but the sudo single_value_read still no-go. After rebooting sudo single_value_read is working. After brief turning off and on - still working. It seems that it is somehow failing after being off for a while. Not sure what's going on... Alex.
×
×
  • Create New...