**** BEGIN LOGGING AT Tue Dec 31 02:59:57 2019 Dec 31 03:15:45 set_: IIRC = If I Remember Correctly Dec 31 03:36:58 Oh! Dec 31 03:37:38 If I Remember Correctly, IIRC. Okay now. I think I got it now. All those acronyms beat me senseless. Onto servos! Dec 31 03:41:40 I suppose it's better than an anachronism Dec 31 03:53:37 I need to look it up. My brain is on servos. I am serving up servos. Dec 31 03:53:46 I am getting ready for the local Maker Faire. Dec 31 03:53:56 I need my bot to do something different this year. Dec 31 03:54:07 Fly a Flag or something. Dec 31 03:54:11 does it twitch a lot? Dec 31 03:54:20 No. Dec 31 03:54:31 I got my servo running smoothly. Sort of. Dec 31 03:54:38 Good that's usually a bad sign. Dec 31 03:54:46 I guess now that you mention it, it may twitch a bit. Dec 31 03:54:55 But, it is a cheap servo. Dec 31 03:55:34 For testing only. The real McCoy comes in later in the month, boy! Dec 31 03:55:42 Servo Madness! Dec 31 03:58:01 A good RC servo shouldn't twitch. what is the update frame rate? It should be about 50 times a second. Dec 31 03:58:47 50 Hz. Dec 31 03:59:21 Well, maybe. Dec 31 03:59:44 I would check that first if you have twitching. Dec 31 03:59:48 The source says 50 is the frequency but it could be anything really. I never got into the testing of the actual signal (yet). Dec 31 03:59:59 Okay. Dec 31 04:00:23 I have four angles. Dec 31 04:00:31 And... Dec 31 04:00:34 You can count that a number of ways. If you have an oscilloscope you can measure the period between rising edges on the signal. Dec 31 04:00:55 The servo moves to those angles w/out any issue but it seems to hesitate some. Dec 31 04:01:42 does it do the same thing at the same angle each time? Dec 31 04:01:58 IE repeatably fail to move at the same position each time. Dec 31 04:02:25 Hmm. Let me check, again. I think it was twitching/hesitating a bit per move but not to the point that it was noticeable to onlookers. Dec 31 04:02:29 Please hold. Dec 31 04:05:45 I guess I was imagining it. The servo tests fine. I thought the noise was the issue, I guess. Dec 31 04:05:56 It turns well. Dec 31 04:08:09 I need to make a flask app for this servo to control it. So, I can wave the R, W, and B in the face of the onlookers! Dec 31 04:08:56 it's important you stay within the specifications of the device you are controlling or weird can happen. That includes the signal you drive it with. Dec 31 04:12:19 well have fun! I have a lot to do I guess. Dec 31 04:23:30 Okay. Thank you. Dec 31 04:24:02 I will keep trying to understand more about the signal. I have been doing some research on servos. Dec 31 04:35:08 Do people actually type in every available angle on a chip from a library so that people can use controllers? Dec 31 04:35:25 There must be an easier way, right? Dec 31 04:36:05 ex. angle1 = 0, angle2 = 1, angle3 = 2, and etc? Dec 31 04:46:34 I got my basics down on a server, i.e. 0, 45, 90, 135, and 180. Nice. Dec 31 04:47:40 GenTooMan: Do you have a lot to do or are you bored w/ my current knowlege base? Dec 31 04:49:10 brb? Dec 31 04:56:33 I was going to bed actually and tomorrow I need to get up early and stuff to do. Dec 31 04:58:30 OH. Dec 31 04:58:32 No issue. Dec 31 04:58:50 I guess we all should sleep from time to time. Good luck and I will chat it up w/ you another day. Dec 31 04:59:14 I have work but... Dec 31 05:00:15 Programming in the night! Dec 31 05:00:55 It is my favorite notion these days. Dec 31 05:03:43 Okay. So, my server is nice and dandy but the servo(s) need to be autonoumous. Onto another idea or two (hopefully). Dec 31 08:53:30 Greetings Dec 31 08:57:51 Can anyone show me to a working example in C programming that implements an interrupt on beagle bone black. Am actually very new to BBB, am trying to see how i can get an interrupt working on my Beagle Bone just like i do with Arduinos. Dec 31 09:01:48 m-blasie: The question is if you really need/want interrupts. I take it you are not doing any special kernel/bare metal programming? Dec 31 09:10:55 Humpelstilzchen: am trying to watch the state of some specific i/o's i assigned for when change occur, i was hoping i could just implement some kind of interrupt that could help me do that while i do other stuffs on the loop. If you have a better suggestion on how to simulate some sort of interrupt,it would well appreciated. Thanks. Dec 31 09:11:57 m-blasie: how fast do you expect those i/os to change? Dec 31 09:12:39 e.g. what is the hardware behind that? Dec 31 09:13:03 Humpelstilzchen: not more than 2seconds? Dec 31 09:14:08 m-blasie: that doesn't sound like a real time requirement for me. You could just watch the input from a usual program Dec 31 09:14:54 Humpelstilzchen: i have got a relay Dec 31 09:15:19 m-blasie: since the bbb usually runs linux which is a full blown os with multithreading etc you usually do not use interrupts to watch for i/o changes Dec 31 09:16:33 *slow i/o changes Dec 31 09:17:00 Humpelstilzchen: Okay, thats really interesting to know Dec 31 09:18:11 m-blasie: just write a program that reads e.g. ever 0.1s the input and let the linux scheduler do the rest Dec 31 09:22:50 i have also got one other challenge, which is using the reconfigurable i/o's. That is am trying to use them as normal GPIO's but i have been unable. Is they a way of achieving that programmitically using C? Dec 31 09:23:55 Humpelstilzchen: oh thank you very much Dec 31 09:27:04 I have no idea what a reconfigurable i/o is :( Dec 31 09:34:55 okay please have a look at this link: https://components101.com/microcontrollers/beaglebone-black-pinout-datasheet Dec 31 09:36:31 you mean the pinmux? Dec 31 09:37:50 like for a pin you can set if it does e.g. uart, i2c or gpio? Dec 31 09:38:06 :( i guess so, am just quoting the author from that link Dec 31 09:38:19 yes exactly Dec 31 09:39:14 you should only do that in a device tree Dec 31 09:39:52 i only know there can be used but i dont know how to use them. I want more GPIO's Dec 31 09:40:28 other than the ones which their default states are GPIO's Dec 31 09:42:16 m-blasie: default should be listed in the SRM Dec 31 09:45:07 m-blasie: you can get events for gpio changes Dec 31 09:45:42 m-blasie: and all reconfigurable pins default to gpio Dec 31 09:48:29 @zmatt: oh really? can you show how to? Dec 31 09:48:30 m-blasie: some pins will be non-reconfigurable if they are occupied for special functions: hdmi video, hdmi audio, or eMMC. these can be disabled by uncommenting lines in /boot/uEnv.txt to free pins up as gpios Dec 31 09:50:38 @zmatt: i have tried using pin 3 from the P8 (i.e MMC1_DAT6) but was unable to Dec 31 09:51:13 yeah that's in use by eMMC Dec 31 09:51:31 if you want a nice overview of your current pin configuration, maybe check out my show-pins utility: https://github.com/mvduin/bbb-pin-utils/#show-pins Dec 31 09:52:19 my suggestion would be to leave the eMMC pins alone unless you really need every last gpio available Dec 31 09:52:35 Humpelstilzchen: yea they are just a few of them that are GPIO's from the pinout from this link: https://components101.com/microcontrollers/beaglebone-black-pinout-datasheet Dec 31 09:53:37 m-blasie: well the pins they labeled "ehrpwm", "spi", and "uart" are in fact all gpio by default Dec 31 09:53:50 @zmatt: how about those pin labelled as LCD_DATA?? Dec 31 09:54:21 (actually the spi1 ones are used for hdmi audio unless disabled) Dec 31 10:09:16 lcd_data is used by hdmi video unless disabled Dec 31 10:09:16 if you don't need hdmi, you can uncomment the disable_uboot_overlay_video=1 line in /boot/uEnv.txt and then all of those pins will be freed up and become gpios by default Dec 31 10:09:16 @zmatt: oh thanks alot! thats interesting to know Dec 31 10:09:16 some of the lcd_data pins do have one additional caution: they are sampled during power-up (about 20ms after the power led turns on) to determine boot configuration. they have fairly weak (100 kΩ) on-board pull-up or pull-down resistors to set that configuration, but if you accidently influence those pins during power-up using an external circuit, the BBB may end up unable to boot **** BEGIN LOGGING AT Tue Dec 31 10:17:38 2019 **** BEGIN LOGGING AT Tue Dec 31 10:26:20 2019 Dec 31 10:28:53 @zmatt:thanks alot, this is so much help Dec 31 10:30:10 gpio 1.28 (expansion header pin P9.12), there's no "pin 1-28" Dec 31 10:39:40 @zmatt: oh! i get you now but is there a C version of this elegant implementation which you just shared? Dec 31 11:03:27 @zmatt: thanks alot am now able to use the LCD_DATA pinouts Dec 31 11:04:55 Humpelstilzchen: thanks alot for your help Dec 31 14:08:59 Greetings! Dec 31 14:12:40 i keep having this error : Bus Error, when i try running blink light test on some I/O's, I cant seem to figure out what is wrong because it compiles but when trying to run the code i get the Bus error. Dec 31 14:13:37 uhh what are you doing? Dec 31 14:14:03 what "blink light test" exactly? Dec 31 14:14:49 bus error generally only occurs when messing with /dev/mem, which is something that should generally be regarded as a last resort thing Dec 31 14:15:09 @zmatt: just a skelectal code that sets a pin HIGH for some second and then sets it back LOW Dec 31 14:15:14 how exactly? Dec 31 14:16:01 because the sysfs gpio interface just involves writing short values to files (well, sysfs attributes technically, but they behave mostly like files), and won't ever cause a bus error Dec 31 14:23:45 @zmatt: i havent messed with /dev/mem, only thing i did was to uncomment the disable_uboot_overlay_video=1 line along side several other ones.could that have been the cause? Dec 31 14:24:37 I'm referring to your code, or whatever that "blink light test" is you're referring to, or whatever library it uses Dec 31 14:27:59 okay! am actually using a C library from this Link : https://github.com/VegetableAvenger/BBBIOlib Dec 31 14:28:21 which messes with /dev/mem Dec 31 14:29:12 and evidently doesn't ensure the gpio controllers are available for access, hence resulting in bus errors Dec 31 14:29:31 and it's clearly unmaintained so no point in filing a bug report ;) Dec 31 14:40:09 oh i see, is there a better Library you suggest that doesn't mess with /dev/mem or how would i identify a library that actually messes with /dev/mem ?? Dec 31 14:44:34 m-blasie: well the fact that it requires your program to run with root privileges is a hint that something is off Dec 31 14:45:11 but also the readme said it was for gpio via memory mapped access Dec 31 14:55:51 dunno about C libraries, but like I said: using gpios via the sysfs interface is pretty similar to accessing files (except generally you'd use open()/close() and read()/write() or pread()/pwrite() rather than buffered file I/O i.e. fopen()/fclose() etc): https://pastebin.com/Ttp4BiuQ Dec 31 14:56:09 this example is completely untested btw, I just quickly wrote it Dec 31 14:57:12 it's also not very efficient to close and reopen the value attribute each time you want to read (or write) it... that and some other details that are handled more cleanly by my C++ wrapper Dec 31 15:16:34 @zmatt: wow! thanks alot, i appreciate the help so far. Am gonna try this once am back on my system. Dec 31 15:17:02 I'm doing a quick conversion of my C++ code to C... it's a lot less work for me than for you ;) Dec 31 15:24:43 wow! that would be great Dec 31 15:45:52 m-blasie: https://pastebin.com/2k81urFj ... untested, but I verified it compiles Dec 31 15:49:11 note that I *think* the latest image probably has symlinks for gpios in /dev/gpio, in which case you can use "/dev/gpio/P9_12" as path instead of "/sys/class/gpio/gpio60" Dec 31 15:49:17 which is obviously a lot clearer Dec 31 15:49:46 I'm not sure though whether I ever gave that udev rule to rcn (or if I did, whether he included it) Dec 31 16:09:10 anyway, I'm afk, happy new year Dec 31 18:29:07 e Dec 31 18:49:55 if m-blasie comes back, here is the update to that library for .c files: https://github.com/shabaz123/iobb. Dec 31 19:17:19 https://pastebin.com/QE0cbUMA is what I am reading right now about how to calculate cycles for PWM references. If you want to pitch in, please do. I know it is a New Year for some people and some people may not reply. Aw! Dec 31 19:17:36 <<<< reading chip info. now. Dec 31 19:19:28 a chip off the old die? Dec 31 19:20:20 Yes Sir! It can handle 48Mhz. Dec 31 19:20:34 Die = block? Dec 31 19:21:50 Well wafer has 2 syllables so I went with die. It's not accurate but what the heck. :D Dec 31 19:22:24 Yea boy! Wafers are nice too, presumably in the night. Dec 31 19:22:33 GenTooMan: Okay, Okay. Dec 31 19:22:48 It is an M0. Dec 31 19:22:53 From ARM. Dec 31 19:22:58 Soo PWM period is relatively easy. You want 50hz for your period correct? Dec 31 19:23:02 I was unaware of the STM chip being of ARM arch. Dec 31 19:23:09 Right. Dec 31 19:23:12 STM32 is ARM Dec 31 19:23:14 Oh. Dec 31 19:23:22 Now, I know. Dec 31 19:23:51 GenTooMan: Did you look at the pastebin.com paste/ Dec 31 19:23:52 ? Dec 31 19:24:39 The reason I am asking is b/c I was going to put two separate PwmDuty Cycle pieces of source in my entire software summary. Dec 31 19:25:29 So: Instead of PWM = 90, it is PWM1 = 90 && PWM2 = xx. Is that going to fly? Dec 31 19:26:11 I can test but I thought it would be more of a conversation than an actual work ethic on my part. Dec 31 19:26:21 TPWM is 65535*0.1 no 4 in their unless you have an additional divider. Dec 31 19:27:02 So, I would use 4.8? Dec 31 19:27:16 what STM32 are you using? Dec 31 19:27:24 Oh. Please hold. I will get the info. Dec 31 19:27:57 STM32F030 Dec 31 19:28:03 Motor Bridge Cape! Dec 31 19:28:27 I have six servos and two to four DC motors to accomplish on this board. Dec 31 19:30:01 p. 14 of the datasheet >>>> 4-32 clock. Dec 31 19:30:19 how much memory and what package (main memory) Dec 31 19:30:48 Hold please. Dec 31 19:31:27 I'm left holding the bag ... again. Dec 31 19:32:16 Dang it, man. Dec 31 19:32:40 GenTooMan: The chip is either 10 * 10 or 7 * 7. Should I measure? Dec 31 19:32:51 I cannot read the fine print. Dec 31 19:33:12 What's on the board? if it looks about 1CM it's 10*10 Dec 31 19:33:22 or 10mm either way Dec 31 19:33:38 I will measure. Dec 31 19:33:40 Please hold. Dec 31 19:33:56 oops dropped the bag. Dec 31 19:34:02 Dang it. Dec 31 19:34:43 10mm Dec 31 19:35:10 10 mm ^ 2! Dec 31 19:35:38 64LQFP Dec 31 19:35:47 memory? Dec 31 19:36:40 So, if the 4-32 Mhz fails, the 8 Mhz backs it up. Dec 31 19:36:43 Memory. Dec 31 19:36:46 Oh. Dec 31 19:36:57 Let me see. Dec 31 19:37:06 Bag droop time. Dec 31 19:37:31 I hate it when my bag droops... it's really weird looking drooping bag and what not. Dec 31 19:38:35 GenTooMan: I do not know if it is the 4, 6, 8, or C. How could i tell? I mean, it might as well be the 6. Dec 31 19:39:13 set_: why are reading this stuff exactly? Dec 31 19:39:35 http://wiki.seeedstudio.com/Motor_Bridge_Cape_v1.0/ has a visual and that visual is larger than any photo I can take. Dec 31 19:39:39 It should say it in the documentation to be honest. :D Dec 31 19:39:50 Oh. Let me go to the datasheet again. Dec 31 19:39:54 hey zmatt thought you were gone for new years Dec 31 19:39:54 there is not actually any reason to read stm32 documentation for using the motor bridge cape Dec 31 19:40:09 Guys. The datasheet has four models, four sizes, and two different layouts. Dec 31 19:40:16 GenTooMan: I was gone to travel to the hackerspace where I'm at for new years, and I'm there now Dec 31 19:40:26 Nice! Dec 31 19:41:32 zmatt That makes sense. Hacking in the new year. :D Dec 31 19:41:54 the stm32 on the motor bridge cape should just be considered an implementation detail, there's not really any reason to read its datasheet Dec 31 19:41:55 Cough! Phew. Dec 31 19:42:05 Oh. Dec 31 19:42:11 Please do not say that. Dec 31 19:42:30 I am readin' the datasheet to find out what GenTooMan wants me to learn. Dec 31 19:42:34 are you actually programming the STM32? or does it already have firmware on it and you send it commands Dec 31 19:42:42 I am commanding it. Dec 31 19:42:44 it has firmware on it that exposes a command interface via i2c Dec 31 19:42:45 w/ Python. Dec 31 19:42:50 smbus2. Dec 31 19:42:51 which has a python binding library Dec 31 19:43:00 Right. Dec 31 19:43:21 so there's emphatically no purpose to reading the stm32 datasheet, but GenTooMan answered what you were asking for instead of what you need to know Dec 31 19:43:27 :P Dec 31 19:43:48 Well then you don't have to worry about the PWM system you just need to send the correct information to the device, that probably is in the documentation (probably) Dec 31 19:44:30 OH well. Dec 31 19:44:38 or just use a python binding, which is what you're already doing anyway Dec 31 19:45:01 Here is the question then. Dec 31 19:45:14 Can I use more than one PWMduty cycles? Dec 31 19:45:24 It is listed at 90. Dec 31 19:45:36 ?? Dec 31 19:45:37 I want to add to my source another value. Dec 31 19:45:53 So, I will have 90 duty and maybe 45 duty. Dec 31 19:46:04 Yes. I typed duty. Dec 31 19:46:24 One question mark is enough. Dec 31 19:46:26 I get it. Dec 31 19:46:26 http://wiki.seeedstudio.com/Motor_Bridge_Cape_v1.0/ shows ANGLE and frequency has parameters for their python interface. Dec 31 19:46:33 Right. Dec 31 19:46:36 I get that. Dec 31 19:46:42 Let me show you what I am doing. Dec 31 19:46:50 Please droop for a bit. Sheesh. Dec 31 19:47:20 don't worry zmatt I will be sure to keep him from blowing anything of yours up. :D Dec 31 19:48:20 https://pastebin.com/2b4JGLyE and this is just the start for the servos but it is the beginning of the script that should be of interest. Dec 31 19:48:39 PwmDuty1 = 90? Can I have more than one of the PwmDuty calls. Dec 31 19:49:06 /o\ Dec 31 19:49:14 @zmatt: Do not change the source. Dec 31 19:49:16 It is fine as is. Dec 31 19:49:26 why is this code so so much worse again than it was the last time you were doing something with flask? Dec 31 19:49:32 I have to teach people at the Maker Faire stuff. I do not need a bunch of stuff you know on my ticket. Dec 31 19:49:40 B/c. Dec 31 19:50:07 I am doing things in an old fashion that has nothing to do w/ current offerings. Do not laugh. Dec 31 19:50:20 create your "motor" _once_ during initialization, call ServoInit _once_ during initialization, do not use time.sleep Dec 31 19:50:22 <> Dec 31 19:50:37 I know, I know. Dec 31 19:50:38 I know! Dec 31 19:50:50 Just stop judgin' the source. Dec 31 19:50:53 do not leave a blank line between your @app.route decorators and the "def updates" that's being decorated Dec 31 19:50:59 Fine. Dec 31 19:51:12 I do things. Dec 31 19:52:26 @zmatt: I feel helpless in Seattle. No soup for you. Okay, outside of the decorators and def functions, let me just say this... Dec 31 19:53:10 I am going to use PwmDuty1 = 45 and PwmDuty2 = 90 and PwmDuty3 = 135. Dec 31 19:53:20 What do you think of that idea? Dec 31 19:53:37 That would be VERY wise. you should always center at 90 with RC servos. Dec 31 19:54:02 My DC motors can go up to 1000. You guys got me confused again. Dec 31 19:54:15 DC Motors. Stop w/ the servos for once. Dec 31 19:54:33 what I think is that those constants are currently not used anywhere in your code, therefore their value is irrelevant Dec 31 19:54:35 You are controlling a DC motor? OK simple enough. Dec 31 19:54:39 For now, let us just discuss these DC Motors and PwmDuty1, 2, 3. Dec 31 19:54:54 I will be controlling dc and servo. Dec 31 19:55:31 @zmatt: I will change the source in time. Do not fret. For now, I need set up scripts to show change so I can explain change and dedication. Dec 31 19:55:49 but PwmDuty is almost certainly in range 0-100, hence 135 is invalid Dec 31 19:55:55 Right. Dec 31 19:55:56 Okay. Dec 31 19:56:10 My PwmDuty goes from 0 to 1000, I am pretty sure. Dec 31 19:56:46 what does that MotorBridgeI look like? Dec 31 19:56:47 I think they mistook 1000 for 100 or it is just in the source as a multiplier. Dec 31 19:56:54 is that something I once wrote or something? Dec 31 19:56:59 Please hold. I will show you. Dec 31 19:57:04 I do not know. Let me show you. Dec 31 19:57:28 @zmatt: Are you Zue or whatever his name was. Lee or Li or whatever. Dec 31 19:57:28 ? Dec 31 19:57:30 because the controller uses 0-1000 but the official python binding has a *10 Dec 31 19:57:33 no Dec 31 19:57:37 Okay. Dec 31 19:57:40 Sorry. Dec 31 19:57:49 Right. That is what I saw. Dec 31 19:58:04 * 10, that is what I saw in the library. Dec 31 19:58:17 but MotorBridgeI isn't an identifier in the MotorBridgeCape binding, so are you using some third party binding or something? Dec 31 19:58:18 So, I need to keep it from 0 to 100. Okay. Dec 31 19:58:40 I just changed the name to the MotorBridge.py file b/c I have many I am dealing w/ right now. Dec 31 19:58:46 ok Dec 31 19:58:53 i.e. MotorBridge.py * 5 or whatever. Dec 31 19:59:03 So, i change the names to suit my needs at the time. Dec 31 19:59:23 MotorBridgeI.py coming up. Please hold. Dec 31 19:59:27 speaking of which set_ for your sanity and everyone else be sure to use appropriate names (IE duty instead of angle, rate instead of frequency). Dec 31 19:59:43 GenTooMan: nono, duty and angle are different things Dec 31 19:59:51 the binding has separate functions for servo and dc Dec 31 19:59:51 Okay. I have dc and servo. Dec 31 19:59:55 Right. Dec 31 20:00:02 And stepper. Dec 31 20:00:10 But, we are not going to that point just yet. Dec 31 20:00:16 Sanity! Dec 31 20:02:02 https://pastebin.com/B4NbiHe1 is one of the MotorBridge.py files. This is the one I am using right now w/ smbus2. Dec 31 20:02:10 Keep in mind, that smbus2 needs to be altered too. Dec 31 20:02:18 So, it will not work out of the box. Dec 31 20:02:26 So why I was I being said to think DC motors? ... Dec 31 20:02:34 Oh. Dec 31 20:02:43 PwmDuty for the DC Motors. Dec 31 20:02:48 PwmDuty is not for the Servos. Dec 31 20:04:23 The servos have a frequency, angle, and name. Dec 31 20:04:49 summary of methods: https://pastebin.com/1i9GD84g Dec 31 20:06:27 They have a dc motor stop. Odd? Dec 31 20:06:37 I never once read that section for some reason. Dec 31 20:06:49 I just told the motors in source to have no power. Dec 31 20:07:36 Dang it. Hey guys. Can I take five? Dec 31 20:07:50 blah. brb. Dec 31 20:08:06 likely to shut off the top and bottom PWM drivers. Ciao. Dec 31 20:12:41 Okay. Dec 31 20:12:52 So, that is out. Dec 31 20:16:22 Anyway, have fun! I am going to rummage. Later. Dec 31 20:16:35 Thank you, you two. Dec 31 20:20:28 I don't know what I accomplished but OK I'll actually work on my BBB for a change :D happy new year Dec 31 21:01:03 @zmatt: Should I use def __init__ as a function on the source I am typing up for the motor = MotorBridge.MotorBridgeCape() and... Dec 31 21:01:37 motor.DCMotorInit() and motor.DCMotorMove()? Dec 31 21:28:29 bbl