**** BEGIN LOGGING AT Sat Mar 19 02:59:56 2022 Mar 19 03:00:51 @zmatt: Before I go for the night, since it is 10:00 over here, am I allowed to discuss this effort of mine from your lib. on the forums? Mar 19 03:51:32 I just wrote my own Python3 script to handle the RelayCape w/ Pathlib! Mar 19 03:51:42 Thank you, thank you. Please, do not stand up. Mar 19 04:00:42 Nice! Mar 19 04:00:45 Okay, done for now. Mar 19 15:46:59 set_: pwrite giving illegal seek? wtf? Mar 19 15:54:15 seems to work fine for me Mar 19 15:54:30 hmm, I did find a mistake in my BBORG_RELAY-00A2 overlay... fixing that now Mar 19 15:56:22 or maybe I didn't, and I didn't check myself whether I had a sufficiently recent kernel installed, lol Mar 19 16:03:34 actually, both are true Mar 19 16:07:51 ah fuck, I get it now Mar 19 16:07:56 hum Mar 19 16:40:17 ugh this sucks Mar 19 16:40:47 I kinda hate the C preprocessor now Mar 19 16:42:03 what I really want is a way to declare constants for use in expressions in dts instead of just replacing every token like cpp does (including node names) Mar 19 17:30:59 set_: my suggestion for now is to just don't use the BBORG_RELAY-00A2 overlay at all (neither mine nor the bb.org one) Mar 19 17:32:02 disable it by removing it from /lib/firmware or use the appropriate disable_uboot_overlay_addr* variable in /boot/uEnv.txt to disable automatic loading of the overlay Mar 19 17:33:09 and just specify the appropriate pin instead, e.g. /dev/gpio/P9_41 for relay-jp1, P9_42 for jp2, P9_30 for jp3, P9_27 for jp4 Mar 19 17:33:59 ohh, I think I just thought of a disgusting hack to fix this problem in overlay-utils Mar 19 17:38:45 YES Mar 19 17:45:10 set_: ok, I've just pushed a properly working BBORG_RELAY-00A2 overlay to overlay-utils Mar 19 23:56:50 Nice. Mar 19 23:56:53 Off to test! Mar 19 23:57:22 I may say something unreasonable. Mar 19 23:57:45 I have had to spray for weeds today and the fumes are in me! Mar 19 23:57:58 "Killing me softly!" Mar 20 00:02:00 git pull obviously did something but the error is still on my output. Mar 20 00:06:46 pathlib still works. So, either I am doing something wrong, probably, or this might be a butter sandwich of ideas that I cannot make work just yet. Mar 20 00:07:04 Either way, I will keep testing. Mar 20 00:11:42 And then, when " echo 1 > value " commands are given, this is the output of no permission: -bash: value: Permission denied Mar 20 00:12:15 So, I also have not been able to run the source under your lib. dir. w/out sudo. So, this is probably it. Mar 20 00:12:32 I will retry from scratch. Mar 20 00:15:01 don't use sudo Mar 20 00:15:20 and yes, you doing something wrong sounds like a reasonable hypothesis Mar 20 00:19:40 Ha. Mar 20 00:20:05 I tried w/out sudo and received permission errors, i.e. even w/ the udev rule. Mar 20 00:20:31 unless your system is entirely broken you should never get permission errors when trying to use gpio Mar 20 00:21:02 I know, oh. So, I do not need the udev rule you mentioned that I called 84-gpio.rules? Mar 20 00:21:02 like, this is something that works normally out of the box on any image Mar 20 00:21:21 Oh. Right. I saw the udev rules for no-root-gpio.rules. Mar 20 00:21:56 it doesn't matter too much what you call my udev rule, but it has nothing to do with permissions Mar 20 00:22:23 yes, /etc/udev/rules.d/80-gpio-noroot.rules is responsible for setting permissions Mar 20 00:22:24 I added another .rules to /etc/udev/rules.d/ Mar 20 00:22:43 Okay. Mar 20 00:23:00 (part of the bb-customizations package) Mar 20 00:23:50 I am going to erase the udev rules that I added in /etc/udev/rules.d/ Mar 20 00:24:04 ehm Mar 20 00:24:08 What? Mar 20 00:24:28 having my udev rules for gpio is still highly recommended too Mar 20 00:24:34 Oh. Okay. Mar 20 00:24:46 that just doesn't have anything to do with permissions, it's for creating symlinks Mar 20 00:25:08 Right, so if this has nothing to do w/ permission errors, which is what I am having now, I will rebuild from scratch. Mar 20 00:25:22 Maybe when I used sudo make install. Mar 20 00:25:32 uhh, what did you make install? Mar 20 00:25:54 Everything in overlays-utils. Mar 20 00:26:13 overlay-utils has nothing to install, its makefile has no install rule Mar 20 00:26:33 It said nothing was needed. So, I politely moved on. I know. I made this error in the beginning. Mar 20 00:26:39 "make: *** No rule to make target 'install'. Stop" Mar 20 00:26:45 Right. Mar 20 00:27:11 So, let me rename overlay-utils and clone it again. Mar 20 00:27:16 ?? Mar 20 00:27:20 this has nothing to do with overlay-utils Mar 20 00:27:40 permissions has nothing to do w/ overlay-utils either? Mar 20 00:27:43 no Mar 20 00:27:46 Hmm. Mar 20 00:28:09 Okay well, this is one for the books. B/c, dmesg is on the way. Mar 20 00:28:10 what does ls -l show on whatever path you were getting permission errors on? Mar 20 00:28:22 Let me show you. Mar 20 00:28:52 root and not debian Mar 20 00:29:54 here : https://pastebin.com/cS4nLPbV Mar 20 00:30:25 ok, pastebin the contents of your /etc/udev/rules.d/80-gpio-noroot.rules Mar 20 00:31:32 Okay. Please hold. Mar 20 00:32:12 https://pastebin.com/mcq1FrjS Mar 20 00:33:34 no that's 85-gpio-noroot.rules, not 80-gpio-noroot.rules Mar 20 00:33:44 Dang it. Mar 20 00:33:48 Okay. Please hold. Mar 20 00:34:14 No such beast. Mar 20 00:34:23 well there's your problem Mar 20 00:34:35 I do not have 80-noroot-gpio.rules Mar 20 00:34:49 it exists normally, so you apparently somehow managed to delete it Mar 20 00:34:51 I have 80-i2c-noroot.rules Mar 20 00:34:58 Nope. I have not. Mar 20 00:35:09 I promise. Mar 20 00:35:14 Serious. Mar 20 00:35:16 the evidence says otherwise Mar 20 00:35:17 I have not. Mar 20 00:35:22 Fine. Mar 20 00:35:54 Where can I find the udev rules for noroot-gpio? Mar 20 00:36:25 I'm trying to figure out why "apt-get --reinstall install bb-customizations" doesn't reinstall that file if deleted Mar 20 00:36:42 Oh. Okay, no issue. Mar 20 00:37:45 right, because it's listed as a config file... so the question is how to get dpkg or apt to restore a config file Mar 20 00:38:00 Serious? Mar 20 00:38:29 I thought I could just add it and then udevadm --Blah Blah. Mar 20 00:41:13 sudo apt-get -o DPkg::options::=--force-confmiss --reinstall install bb-customizations Mar 20 00:41:55 Argh. Mar 20 00:42:03 Okay. Mar 20 00:42:19 that will reinstall any missing config files Mar 20 00:42:29 I guess you could also just recreate that one file Mar 20 00:42:36 but who knows what else got mangled Mar 20 00:43:30 is bb-customizations still a thing? Mar 20 00:43:37 ehm, yes? Mar 20 00:43:40 why would it not be? Mar 20 00:43:43 Oh. Okay. Mar 20 00:43:55 It would not be b/c I know nothing. Are you new? Mar 20 00:43:56 Ha. Mar 20 00:44:04 I thought everyone knew I knew nothing. Mar 20 00:44:23 Okay. Mar 20 00:44:28 So, I will do it. Mar 20 00:44:39 Should I report any adverse affects? Mar 20 00:45:00 ? Mar 20 00:45:28 Like if the board halts its actions and does not reply to my commands...then should I say something? Mar 20 00:45:41 ?? Mar 20 00:46:58 Okay. Mar 20 00:47:04 Let me try the command. Mar 20 00:47:11 It is working so far. Mar 20 00:47:47 Do I need to restart? Mar 20 00:49:17 82-gpio-config-pin.rules is something I have on my /etc/udev/rules.d/ dir. Mar 20 00:49:37 the command should have created 80-noroot-gpio.rules Mar 20 00:49:48 It did not Mar 20 00:49:56 wtf Mar 20 00:50:01 Serious. Mar 20 00:50:04 It did not. Mar 20 00:50:20 can you pastebin the output of apt-cache policy bb-customizations Mar 20 00:50:32 Sure. Mar 20 00:50:34 Please hold. Mar 20 00:50:42 or just, what version of bb-customizations did it install? Mar 20 00:51:39 Installed: 1.20220316.0-0~bullseye+20220316 Mar 20 00:51:53 oh wtf why are you on bullseye? Mar 20 00:52:05 Oh. B/c...I am testing. Mar 20 00:52:07 (also, wtf why is that udev rule missing on bullseye?) Mar 20 00:52:19 See. Now, you got the question correct. Mar 20 00:52:24 rcn-ee: what happened to 80-noroot-gpio.rules on bullseye? Mar 20 00:52:31 Why is the udev rule not already there on Bullseye? Mar 20 00:53:24 (or an equivalent rule to set sysfs gpio permissions) Mar 20 00:53:52 Hmm. It seems this may be a fault of the char driver persons? Mar 20 00:54:04 GPIO this chip that. Mar 20 00:54:13 Dang it. Mar 20 00:56:25 set_: please stop "testing" bullseye... you have no capacity to distinguish between issues with bullseye and issues you've caused yourself Mar 20 00:57:11 you're just creating more confusion for yourself and more work for me in trying to decode what's going on Mar 20 01:00:29 Okay. Mar 20 01:00:54 I am not going to write a new image tonight for now. Mar 20 01:01:17 I will "update" to Buster later. Mar 20 01:01:38 I just assumed everyone was testing w/ this image and kernel. Mar 20 01:01:46 That is my mistake. Mar 20 01:02:16 There are so many of them right now on the "shelf." It is hard to test one and stay w/ it. Mar 20 01:02:40 just use the latest official image Mar 20 01:03:06 Where is that now? Mar 20 01:03:16 the same place it's always been? Mar 20 01:03:23 On beagleboard.org/latest-images? Mar 20 01:03:27 yes Mar 20 01:03:50 Argh. Last I tried it was updating and upgrading. I will go back. Mar 20 01:03:52 Sheesh. Mar 20 01:03:57 ?? Mar 20 01:04:28 There is a lot of work to be done. One cannot just assume everyone is using the same image and kernel, right? Mar 20 01:04:41 most people are yes Mar 20 01:04:43 Oh. Mar 20 01:05:36 Hmm. Okay, my mistake. It just seems like b/c of the forums, things changed a bit. The kernels people use and the images too are all available in plain sight for people like me to just get, grab, and go. Mar 20 01:06:33 I will get an older image to "steal" the show w/ the 80-noroot-gpio.rules file. Mar 20 01:07:22 Then, I can use this lib. Oh hey, @zmatt, can I chat about your lib. on the forums once I get it working correctly due to udev and "my" missing files? Mar 20 01:07:39 ? Mar 20 01:07:50 what do you mean by "chat about" my lib? Mar 20 01:08:38 Serious. Oh, I want to discuss it w/ random people that may seem to like it. Polls of libs. once created are fun. I know this is usually more serious than just plain-Jane fun around here. Mar 20 01:09:09 But...I am not ordinary groupy. Mar 20 01:09:22 * set_ is like a monster groupy. Mar 20 01:09:23 Ha. Mar 20 01:09:51 Anyway, I joke, I kid, and I tell lies. Mar 20 01:10:08 So, back to the ole, drawing board for me. Mar 20 01:10:10 Argh. Mar 20 01:10:41 Have you ever heard that song? Mar 20 01:11:15 "and we are telling lies." It is some American country song from the '50s I guess. It is awesome! Mar 20 01:11:40 It may be called, "If you like sinnin'." Mar 20 01:11:57 Anyway, sorry to waste your time AGAIN! Mar 20 01:14:10 SUBSYSTEM=="i2c", GROUP="gpio", ACTION=="add", \ <<< Can i use this idea but w/ the SUBSYSTEM=="gpio", for noroot-gpio.rules? Mar 20 01:14:22 no Mar 20 01:14:27 Dang it. Mar 20 01:14:45 Okay. I will go and search around to see if I can find it. Mar 20 01:14:52 https://github.com/beagleboard/customizations/blob/master/etc/udev/rules.d/80-gpio-noroot.rules Mar 20 01:15:07 Hey, how did you know where it was located? Mar 20 01:15:54 google Mar 20 01:16:46 Google, heh. Well...I will try to handle my searching skills later. time to update! Thank you. Mar 20 01:18:45 Dang it. Not so easy. Mar 20 01:21:04 It has been a while since the beagleboard/customizations has been updated. Mar 20 01:21:46 yeah I think this is actually the correct repository, but the file is the same anyway: https://github.com/rcn-ee/repos/blob/master/bb-customizations/suite/buster/debian/80-gpio-noroot.rules Mar 20 01:22:01 Oh. Okay. Mar 20 01:22:06 Well, I tried it out. No go. Mar 20 01:22:29 It did work. Mar 20 01:22:38 I had to reboot the machine. Mar 20 01:22:57 I still get that illegal seek for some reason. Mar 20 01:23:52 maybe b/c of gpio_open_output being before gpio_open in the source? Mar 20 01:24:44 This is my issue still >>> pwrite /dev/gpio/relay-jp3/value: Illegal seek Mar 20 01:25:05 uhh, what does your source look like? Mar 20 01:25:13 I research the issues for this idea. I came across many man pages but...oh. Mar 20 01:25:19 Please hold. I will show you. Mar 20 01:26:35 Here: https://pastebin.com/5TntRiBc Mar 20 01:26:58 why are you opening a gpio twice? don't do that Mar 20 01:27:02 Oh. Mar 20 01:27:13 I could not compile in any other format so far. Mar 20 01:27:17 also, this can't possibly compile... or at least it shouldn't Mar 20 01:27:25 It did! Mar 20 01:27:32 w/ make! Mar 20 01:28:00 ugh wtf C why does this not give an error Mar 20 01:28:00 Of course, I added the file in the Makefile to be converted. Mar 20 01:28:08 Ha. Mar 20 01:28:15 What did I do? Mar 20 01:28:44 I opened the GPIO device twice. Okay but what else? What else did I do that is incorrect? Mar 20 01:28:50 I guess it's allowing implicit conversion from pointer to bool, but that's fucked up Mar 20 01:29:04 still doesn't explain the illegal seek, that's really bizarre Mar 20 01:29:09 Hmm. Yea and about that... Mar 20 01:29:14 Sir, get this. Mar 20 01:29:29 passing "low" or "high" is bogus btw Mar 20 01:29:36 I could not compile in any other way. When you say converting bool to pointer. Mar 20 01:29:36 it's expecting a boolean, not a string Mar 20 01:29:45 Oh. It works. Mar 20 01:29:49 It turns on! Mar 20 01:29:59 "low" is interpreted as true, i.e. as high Mar 20 01:30:02 "high"" is interpreted as true, i.e. as high Mar 20 01:30:06 It just does not turn off, i.e. Ha. Mar 20 01:30:07 "sdfdskjfdhskjf" is interpreted as true, i.e. as high Mar 20 01:30:08 Right. Mar 20 01:30:10 Now, I know. Mar 20 01:30:14 Ha. Mar 20 01:30:19 Okay. Mar 20 01:30:21 I got it now. Mar 20 01:30:25 This is the issue. Mar 20 01:30:33 Let me retest. Mar 20 01:30:38 it's really dumb that this doesn't cause an error though Mar 20 01:30:46 like, I understand why this is so, but it sucks Mar 20 01:31:15 So, I need a 0 or 1 or a true or false? Mar 20 01:32:05 You say bool. True of False. Mar 20 01:32:06 Okay. Mar 20 01:32:23 But, did your source change any of that aspect to the boolean values? Mar 20 01:33:16 Now. Mar 20 01:33:17 you can use either 0/1 or false/true Mar 20 01:33:29 maybe I should make the argument int instead of bool Mar 20 01:33:37 It turned off and the permissions issue is back but w/ open and not pwrite. Mar 20 01:33:49 No issue. Boolean values are fine. Mar 20 01:34:09 ok I can reproduce the seek, lemme see what's going on Mar 20 01:34:14 open /dev/gpio/relay-jp3/direction: Permission denied Mar 20 01:34:15 Okay. Mar 20 01:34:43 you can't change the direction of these gpios... they're controlling relays so they're always output Mar 20 01:34:51 Aw. Okay. Mar 20 01:35:00 Darf. Mar 20 01:37:06 oh I see the problem, it's your fault... although the error message could have been clearer Mar 20 01:37:15 Oh. Mar 20 01:37:24 I know this idea has to be true. Mar 20 01:37:48 you used gpio_open() with the last argument (bool input_only) set to true ("low") Mar 20 01:37:59 Yes... Mar 20 01:38:08 which will cause any attempt to perform a write to fail, since you opened it as input-only Mar 20 01:38:11 Aw. Mar 20 01:38:30 this code makes no sense anyway Mar 20 01:38:36 So right, the lib. stated that the input only boolean value is for input and not output. Mar 20 01:38:39 Ha. Mar 20 01:38:44 just use gpio_open_output() open and initialize an output Mar 20 01:38:52 Okay. Mar 20 01:38:57 and use gpio_write() to change it Mar 20 01:39:02 Aw. Mar 20 01:39:04 Okay. Mar 20 01:39:18 don't use gpio_set_direction_output except to change a bidirectional pin from input to output Mar 20 01:39:28 gpio_write() is for the change. I read incorrectly (as usual). Oh. Nice. Mar 20 01:39:39 Okay. Mar 20 01:39:42 also dunno what you're doing with the timeout thing, none of that makes sense Mar 20 01:40:01 Hhahaha. I know. Mar 20 01:40:06 the timeout was part of the input example which was waiting for input changes Mar 20 01:40:11 Right. Mar 20 01:40:18 I kept it for the glory. Mar 20 01:40:34 you kept it to confuse people, gotcha Mar 20 01:40:42 No. Mar 20 01:40:55 For the idea of me being me. Not for others. Mar 20 01:41:02 Ha. Mar 20 01:41:10 maybe I should use enums instead of booleans, just for type-safety Mar 20 01:42:34 Ut oh. Mar 20 01:42:51 given how eager C/C++ is to convert any shit you provide into a bool Mar 20 01:43:04 I think i blinked so quickly, I could not see it. Mar 20 01:43:11 LEDs! Mar 20 01:50:40 Well... Mar 20 01:50:47 I turned the switch into a buzzer. Mar 20 01:51:04 Hhahah. Dang it. Mar 20 01:52:10 and done. Almost rest time. Mar 20 01:52:14 Phew. Mar 20 01:52:47 Luckily it compiled w/ my sleep ideas. Mar 20 01:53:40 @zmatt: Sorry for the trouble. It all works and dandy like. Mar 20 01:53:52 Way to go, sir. May I pause for intermission? Mar 20 02:02:22 I used uSleep for 5000 in my source and the switch turned into a buzzer. Oops. Mar 20 02:05:01 @zmatt: Do you ever have to compile w/ specific statements for usleep? Mar 20 02:05:48 Not in general, you. I am asking about if you do it for BBB or am335x related tasks... Mar 20 02:06:59 Never mind. I am seeing that compiling physical files like QCSRC are maybe for .asm files? Mar 20 02:08:00 Wait, this is for .c files. Mar 20 02:08:58 So, naming a member in a source file, C/C++, "needs" specific statements for compilation. Hmm. Neat. Mar 20 02:10:13 I have only been introduced to command line compilation commands so far. I am not too in depth right now on this effort. Mar 20 02:32:26 ????? Mar 20 02:32:47 Forget it. Mar 20 02:33:20 It works. I thought I had to use nanoseconds but that had not been introduced until 5.13.x or somewhere around that kernel. Mar 20 02:33:37 So, my kernel will not work for that idea. Mar 20 02:33:39 usleep() and nanosleep() both exist, and both have existed for a very very long time Mar 20 02:33:44 Oh. Mar 20 02:34:07 I know usleep() has existed. I just saw nanosleep() as its replacement. Mar 20 02:34:31 I mean, usleep is fine for most purposes and it ain't going anywhere (regardless of what POSIX might think) Mar 20 02:34:38 Oh. Mar 20 02:34:39 Okay. Mar 20 02:34:48 This is good news. Mar 20 02:36:26 I'm pretty sure usleep() is actually simply implemented as a wrapper around nanosleep() Mar 20 02:37:05 Oh. Mar 20 02:37:08 Hmm. Okay. **** ENDING LOGGING AT Sun Mar 20 02:59:57 2022