**** BEGIN LOGGING AT Wed Aug 29 03:00:03 2018 Aug 29 14:36:40 m Aug 29 15:33:40 This is my code for using a BB Blue to read from a temperature sensor using SPI: https://pastebin.com/JNVbP7Hu Aug 29 15:33:56 I am getting the error: "ERROR in rc_spi_read: Invalid argument" . does anybody know why or has seen this before? Aug 29 17:21:30 fewss: try uint8_t * data instead of (uint8_t*)data Aug 29 17:21:45 fewss: mind you my c is rusty, so i could be wrong Aug 29 17:25:00 I will try that now. Aug 29 17:26:58 That threw some errors when compiling Aug 29 22:12:29 i see there are recent images for the BBB based on Debian. Do they have 3D accel? what kernel is on them? just asking so I can decided appropriately before downloading (metered connection here) Aug 29 22:14:15 sicelo: unfortunately 3d accel is a chore to get working Aug 29 22:14:29 wmat: your C is clearly very rusty :P Aug 29 22:15:33 i can imagine. powervr, i guess Aug 29 22:16:39 fewss: your temperature sensor returns a double-precision float in little-endian format? that seems extremely unlikely. also your code has a buffer overflow Aug 29 22:16:56 fewss: neither of those things are likely to result in EINVAL though Aug 29 22:18:26 but the other hardware, does it all work nicely with newer kernels, and is the kernel upstreamed? Aug 29 22:19:51 not all features in TI kernels at any given point in time are in mainline necessarily, but upstreaming drivers is a continuous effort by TI Aug 29 22:21:09 thanks. i'm downloading image in the meantime. Aug 29 22:22:02 zmatt: should I be using a float instead of a double? Aug 29 22:22:07 if you have a metered connection and are comfortable with debian, you might consider downloading the console image instead of the iot image and just install things you need Aug 29 22:23:10 fewss: that sounds equally implausible, but I have no way of telling you how your unspecified sensor works Aug 29 22:23:57 fewss: what kind of sensor are you using? Aug 29 22:24:01 oh. the perils of skimming. i didn't notice there's a console iamge. i was downloading iot. will recheck Aug 29 22:24:39 oh right, sorry! it's a RTD PT 100 connected to MAX31865, then using SPI to connect to BB Blue Aug 29 22:24:50 sicelo: it's not in the list at latest-images because they don't want newbies to use it Aug 29 22:25:09 https://learn.adafruit.com/adafruit-max31865-rtd-pt100-amplifier/overview Aug 29 22:25:09 sicelo: hence my qualifier "if you're comfortable with debian" ;) Aug 29 22:25:13 sicelo: https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Stretch_Snapshot_console Aug 29 22:25:51 awesome. thanks. i am comfortable enough with debian :) Aug 29 22:26:33 fewss: still, none of this is responsible for the EINVAL, unless it's somehow caused by your buffer overflow, but I don't think so (especially since no data should have been written to the buffer anyway due to the EINVAL) Aug 29 22:27:28 there is no chance the code as written will work. Aug 29 22:27:55 correct, but I'm trying to understand the EINVAL Aug 29 22:28:19 (sorry, it is far enough away that I cannot give you a concise, more useful answer) Aug 29 22:28:32 zmatt: I suspect the clock out buffer is invalid somewhere Aug 29 22:29:07 oh never mind it's not a buffer overflow actually Aug 29 22:29:34 I just noticed the nonsensical double data[bytes] ... which although being nonsense does allocate a buffer that's plenty big enough Aug 29 22:29:41 regardless, that still doesn't explain EINVAL Aug 29 22:29:53 it's a valid pointer, and an invalid pointer would yield EFAULT anyway Aug 29 22:30:35 so it is probably an issue with my data/bytes variables? Aug 29 22:31:07 I'm really not sure yet what's causing the EINVAL Aug 29 22:31:34 there isn't an error in the kernel log by any chance? (check e.g. with journalctl -k or with dmesg) Aug 29 22:33:00 oh lol Aug 29 22:33:27 it's simply a bug in librobotcontrol, which got fixed 12 minutes ago Aug 29 22:33:46 https://github.com/StrawsonDesign/librobotcontrol/commit/2efd53449998 Aug 29 22:34:01 oh yes, I just got a response from james strawson Aug 29 22:34:24 apparently it was an issue with input/output control padding at the end of the SPI transfer structs being non-zero Aug 29 22:37:09 anyway, as for the correct transfers to perform, you will either have to find example code for the MAX31865 or consult the data sheet Aug 29 22:37:47 datasheet looks pretty straight forward Aug 29 22:38:06 on the clock out - put in a number 0-8, and that register clocks in. just need to figure out what reg, etc Aug 29 22:38:36 for a tempt sensor, you can be totally rediculous and use sysfs + gpio to talk to it ;) Aug 29 22:38:44 s/tempt/temp/ Aug 29 22:40:54 how do I set the clock out? Aug 29 22:41:27 the underlying APIs provide for it...donno about your libraries Aug 29 22:41:59 SPI is nothing more then a pair of shift registers. One on the AM335x and one on the MAX3xxxx Aug 29 22:42:40 MOSI - input to the one on the MAX3xxxx and output of the AM335x; MISO - input to the AM335x, output on the MAX3xxxx Aug 29 22:43:06 for every byte in, you clock out one byte Aug 29 22:44:44 ok, yeah i have it set up like that as of now Aug 29 22:44:54 I will give it a try with the new librobotcontrol update Aug 29 22:44:56 thank you! Aug 29 22:53:04 fewss: https://pastebin.com/CgA9mjNy Aug 29 22:54:15 for the meaning of those registers, see datasheet Aug 29 22:59:01 great, I will give this a try! Aug 29 23:17:15 zmatt: so this is needed for reading from the max31865? Aug 29 23:29:44 zmatt: thx, i figured it was Aug 29 23:30:24 zmatt: +20 Aug 29 23:43:04 fewss: I just made some wrappers for reading and writing the registers of the max31865 documented in the datasheet Aug 29 23:43:33 (completely untested of course) Aug 29 23:49:58 okay. so for example, I would use the read_temp() function instead of the way i am using rc_spi_read right now Aug 29 23:50:55 i see you used rc_spi_transfer instead of read Aug 29 23:53:31 none of the spi transfers documented in the datasheet are read-only transfers, since part of the transfer is writing the address of the register you want to read (or write) Aug 29 23:53:46 so spi_read() is useless for this chip Aug 29 23:55:17 and yes presumably you can read the temperature with read_temp() after you've configured the sensor properly Aug 29 23:56:13 oh ok that makes sense Aug 30 00:09:45 To configure the sensor, do I just need to find the right value for "config" in this line? : static void write_config( uint8_t config ) Aug 30 00:09:48 in the datasheet Aug 30 00:32:05 there is no such thing as a read only op in SPI (higher level concepts may try to push this on people but... Aug 30 02:06:27 GenTooMan! Aug 30 02:07:25 I say, I say, I say. Aug 30 02:08:50 Do you remember out conversation on BJT and how to configure the math around battery supplies/ Aug 30 02:09:43 Well GenTooMan: I have an odd cap. This cap, even from the mfg, is unheard of. It is a missing article. Aug 30 02:09:59 ... Aug 30 02:10:07 Do you want to send assistance on this issue? Aug 30 02:10:12 what are you doing with the cap? Aug 30 02:10:49 Trying to understand if it can handle my battery supply before the supply hits my L298 H-Bridge. Aug 30 02:11:24 No sparks and no smoke is a plus! Aug 30 02:11:54 I was trying to understand dissapation but this specific cap does not have any datasheet. Aug 30 02:12:00 eh? Aug 30 02:12:03 sequencing or? Aug 30 02:12:12 what kind of cap are you using? Aug 30 02:12:38 No clue! This cap states on it and I quote, "100 10v UT." Aug 30 02:13:11 I have been searching the net. I cannot find a datasheet on it. Aug 30 02:13:26 you sure it isn't 100uF, 10V (the u is the green letter mu) Aug 30 02:13:36 No. Aug 30 02:13:43 capacitors are sized by farads and max voltage Aug 30 02:13:47 It just has that insignia on it. Aug 30 02:13:49 Right. Aug 30 02:13:59 This is a capacitor. Aug 30 02:14:05 okay, what kind? electrolytic or? Aug 30 02:14:05 Do you want a photo? Aug 30 02:14:12 sure Aug 30 02:14:14 No datasheet. I do not know. I am sorry. Aug 30 02:14:45 https://github.com/silver2row/pyBot/blob/master/photos/cap.jpg Aug 30 02:14:47 unless you are looking for how non-ideal it is, datasheets are often unneeded Aug 30 02:15:23 I need to know if my battery supply will inevitably total (in a negative way) my L298 driver. Aug 30 02:15:42 looks like a SMT Aluminum electrolytic; 10V Max, 100uF Aug 30 02:15:47 Oh! Aug 30 02:15:51 For real? Aug 30 02:15:59 Cool! Aug 30 02:16:19 no guarantees but if I saw that, that's what I would take it as... not my fault if things go up in smoke :D Aug 30 02:16:32 Hhahahah. No joke. Aug 30 02:17:14 ds2: I have been trying other methods of 12v batteries but this battery is larger and cranks more Ah. The rating is 3.3Ah. Aug 30 02:17:29 I do not want to test it if the fault is going to be mine. Aug 30 02:17:37 eh? Aug 30 02:17:40 eh? Aug 30 02:17:43 what do you mean by methods of 12V Aug 30 02:17:57 I had other 12v batteries that had a lower Ah rating. Aug 30 02:18:25 are you trying to power a lot of things or need a particular run time or???? Aug 30 02:18:32 Both things. Aug 30 02:18:36 What chemistry? Aug 30 02:18:57 I am powering two geared motors and trying to make it run as long as it can. Aug 30 02:19:02 Lead acid. Aug 30 02:20:06 The L298 can handle 50v max but I am afraid that this cap will not work well under those conditions or w/ higher Ah ratings at 24v. Aug 30 02:20:37 no idea what you are talking about - what is the cap for? Aug 30 02:21:29 I figured the cap is for charging or handling surge. Aug 30 02:21:37 In this case, handling surge. Aug 30 02:21:47 Let me read it again. Aug 30 02:21:49 Hold please. Aug 30 02:21:50 what kind of surges are you expecting? Aug 30 02:22:55 you are doing this on the Blue or ? Aug 30 02:23:12 Well, I am dealing w/ 12v 3.3Ah lead acid. Who knows if this will allow for "levelness" or if my cap can make things not surge. Aug 30 02:23:13 BBB Aug 30 02:24:06 BBBlack or BBBlue? Aug 30 02:24:09 Black. Aug 30 02:24:29 Okay. Aug 30 02:24:36 I must understand one thing. This prevents/blocks the current flow in DC applications. Aug 30 02:25:08 That is a true statement but so is saying the sky is blue :D Aug 30 02:25:13 I need to make sure that my battery supply/power does over compensate my cap. Aug 30 02:25:27 The sky is blue! Aug 30 02:25:28 the battery can't over compensate Aug 30 02:25:33 Okay. **** ENDING LOGGING AT Thu Aug 30 02:25:41 2018