Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Charles Ford
Nov 27, 2004

The Earth is a farm. We are someone else’s Ford Focus.
If you want really small you could try a wESP32. It kind of irritates me it uses an ESP32 for wired, though, but it's all mostly "out the box" ready to use, platform.io knows about it, etc. It's not even cheap, though.

I was actually thinking about just designing my own wee PCB with a PHY, PoE chip and an NXP ARM or whatever, using the wESP32's POE side as a reference, but I haven't started that yet.

Adbot
ADBOT LOVES YOU

ryanrs
Jul 12, 2011

That's a good idea. I keep forgetting ESP32 exists since I've never used it before. It looks like there's a ssh server available (which is closer to what I want than than https). Add a Lua shell and you can start blinking some LEDs.

On the Linux side, I do love the idea of twiddling GPIOs by echoing 1s and 0s to files in /proc/gpio. The Rock Pi S has wifi, which I could use to chat with normal ESP32s. They could poo poo plaintext UDP packets at each other and rely on wifi for security.

(I'm building out sensor coverage for a semi-outdoors area. Some places have power, some have network, and I want to add as little new cabling as possible.)

e: $55 for the wESP32 is kind of a lot

ryanrs fucked around with this message at 08:32 on Mar 17, 2024

mobby_6kl
Aug 9, 2009

by Fluffdaddy
If you have POE in some locations, maybe get a :5cbux: splitter and use any normal ESP32 board instead of that $50 one?

I've used ESPs quitea bit to host a minimalist web server that I used to operate whatever functionality. Some sort of REST API is doable too.


Speaking of which, I haven't touched anything in a while and wanted to quickly make a temperature logger to diagnose fridge behavior. I had an AWS API set up from a previous project that just stores json values in a DynamoDB table. I had it working fine before and just tested that it still works with curl right now:
code:
curl -d "{'chipid':12345,'timestamp':'2024-01-01','air_temp':21.23,'}" -H "Content-Type: application/json" -X POST https://ABCDEF.execute-api.eu-west-1.amazonaws.com/beta
However I can't get it to work in a new project. I tried a few HTTP libraries, the most updated one seems to be ESP8266HTTPClient (I fried my last spare 32). The BasicHttpsClient example works, but if I just change it to POST to my API endpoint, it always fails to connect with code -1.

C++ code:
    std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);

    //client->setFingerprint(fingerprint_sni_cloudflaressl_com);
    // Or, if you happy to ignore the SSL certificate, then use the following line instead:
    
     client->setInsecure();
     //client->setCiphersLessSecure();
     //std::vector<uint16_t> myCustomList = { BR_TLS_RSA_WITH_AES_256_CBC_SHA256, BR_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, BR_TLS_RSA_WITH_3DES_EDE_CBC_SHA };
     //client->setCiphers(myCustomList);


    HTTPClient https;

    Serial.print("[HTTPS] begin...\n");
    if (https.begin(*client, "https://ABCDEF.execute-api.eu-west-1.amazonaws.com/beta", 443)) {  // HTTPS

      //Serial.print("[HTTPS] GET...\n");

      https.addHeader("Content-Type", "application/json");
      int httpCode = https.POST("{\"chipid\":42069,\"timestamp\":\"2024-01-01\",\"air_temp\":21.23");
      }
There's no API key or anything as you can see from the curl example so I've tried several permutations of setting up the connection security but none of them work. Is there something weird on the ESP8266? I've had no issues in past projects even uploading data stuff to S3 but i'm completely stuck here.

Shame Boy
Mar 2, 2010

mobby_6kl posted:

If you have POE in some locations, maybe get a :5cbux: splitter and use any normal ESP32 board instead of that $50 one?

I've used ESPs quitea bit to host a minimalist web server that I used to operate whatever functionality. Some sort of REST API is doable too.


Speaking of which, I haven't touched anything in a while and wanted to quickly make a temperature logger to diagnose fridge behavior. I had an AWS API set up from a previous project that just stores json values in a DynamoDB table. I had it working fine before and just tested that it still works with curl right now:
code:
curl -d "{'chipid':12345,'timestamp':'2024-01-01','air_temp':21.23,'}" -H "Content-Type: application/json" -X POST https://ABCDEF.execute-api.eu-west-1.amazonaws.com/beta
However I can't get it to work in a new project. I tried a few HTTP libraries, the most updated one seems to be ESP8266HTTPClient (I fried my last spare 32). The BasicHttpsClient example works, but if I just change it to POST to my API endpoint, it always fails to connect with code -1.

C++ code:
    std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);

    //client->setFingerprint(fingerprint_sni_cloudflaressl_com);
    // Or, if you happy to ignore the SSL certificate, then use the following line instead:
    
     client->setInsecure();
     //client->setCiphersLessSecure();
     //std::vector<uint16_t> myCustomList = { BR_TLS_RSA_WITH_AES_256_CBC_SHA256, BR_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, BR_TLS_RSA_WITH_3DES_EDE_CBC_SHA };
     //client->setCiphers(myCustomList);


    HTTPClient https;

    Serial.print("[HTTPS] begin...\n");
    if (https.begin(*client, "https://ABCDEF.execute-api.eu-west-1.amazonaws.com/beta", 443)) {  // HTTPS

      //Serial.print("[HTTPS] GET...\n");

      https.addHeader("Content-Type", "application/json");
      int httpCode = https.POST("{\"chipid\":42069,\"timestamp\":\"2024-01-01\",\"air_temp\":21.23");
      }
There's no API key or anything as you can see from the curl example so I've tried several permutations of setting up the connection security but none of them work. Is there something weird on the ESP8266? I've had no issues in past projects even uploading data stuff to S3 but i'm completely stuck here.

You're missing a closing curly brace at the end of your POST string

The Wonder Weapon
Dec 16, 2006



I'm trying to do some basic led strip lights and I've hit two in a row that I'm having trouble with. I can't tell if it's bad product, or if it's something I'm doing wrong.

I ordered this LED strip: (RGB, 5050 120led IP21) https://www.aliexpress.us/item/2251832623526022.html?spm=a2g0o.order_list.order_list_main.11.73411802IGgASW&gatewayAdapt=glo2usa
These bluetooth controllers: https://www.aliexpress.us/item/3256805081032487.html?spm=a2g0o.order_list.order_list_main.17.73411802IGgASW&gatewayAdapt=glo2usa

I cut the strip on what I'm pretty sure are the cut marks, and connected it all as you see here:


The first timeI did this with, only the red and blue LEDs work. So I returned that, and bought another. This new strip, which is a different product from a different company, with a different bluetooth controller, appears to only have working red diodes. I can't get it to display any blue or green when using the app. I tried swapping to a different controller too, in case that was the issue.

Is this LED strip not the product I thought it was? Did I cut it incorrectly? Is there a problem with the way I've got it connected? I want to know if it's my fault before I submit another defective product return to Ali.

mobby_6kl
Aug 9, 2009

by Fluffdaddy

Shame Boy posted:

You're missing a closing curly brace at the end of your POST string
:doh: I am, but this is just in the example I copied from the curl test, in the actual code I had real valid json



The Wonder Weapon posted:

I'm trying to do some basic led strip lights and I've hit two in a row that I'm having trouble with. I can't tell if it's bad product, or if it's something I'm doing wrong.

I ordered this LED strip: (RGB, 5050 120led IP21) https://www.aliexpress.us/item/2251832623526022.html?spm=a2g0o.order_list.order_list_main.11.73411802IGgASW&gatewayAdapt=glo2usa
These bluetooth controllers: https://www.aliexpress.us/item/3256805081032487.html?spm=a2g0o.order_list.order_list_main.17.73411802IGgASW&gatewayAdapt=glo2usa

I cut the strip on what I'm pretty sure are the cut marks, and connected it all as you see here:


The first timeI did this with, only the red and blue LEDs work. So I returned that, and bought another. This new strip, which is a different product from a different company, with a different bluetooth controller, appears to only have working red diodes. I can't get it to display any blue or green when using the app. I tried swapping to a different controller too, in case that was the issue.

Is this LED strip not the product I thought it was? Did I cut it incorrectly? Is there a problem with the way I've got it connected? I want to know if it's my fault before I submit another defective product return to Ali.
Did you test the new strip before cutting & soldering it? It seems to be joined properly but they can be sensitive to a good connection.

If you have a multimeter you could test either the controller output, or the LEDs on the strip directly.

Base Emitter
Apr 1, 2012

?
TIL KiCad's electrical rules checker doesn't notice when you've got your power backwards, just whether its connected or not.

Magic blue smoke: released.

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
How would it know? You tell it what is positive voltage and what is ground and you connect the pins together. Was one of your footprints wrong? Or do you mean like connecting to a barrel jack? It wouldn't know in that case either because barrel plugs come in both polarities.

Base Emitter
Apr 1, 2012

?
Its a "god I'm a dumbass" post, not a serious one. What actually happened is I apparently rotated the power symbol for a multiple op amp 180deg without noticing and connected it backwards. It did literally blow the lid on the chip, lol

In principle you could make an ERC that is smart enough to notice that if you add enough metadata to your power symbols but what KiCad supports clearly won't do that.

+1 entry to the list of absolutely stupid-assed mistakes to check for manually.

some kinda jackal
Feb 25, 2003

 
 
Not production quality, but conceptually should I be able to sniff a CAN bus by just inserting oscilloscope probes into a connector with CAN-H and CAN-L traffic?

I'm tapping the CAN-H/L pins on a device on my bike with two needles jammed into the connector and I see the differential signals on my DHO914 but for the life of me I can't get it to either trigger on, or decode the CAN packets and I can't figure out why. Voltage is what I'd expect with high and low base ~2.5v referenced to ground.

I guess there's two scenarios here assuming I haven't just hosed up something super basic on the scope. My needle tap is way too janky to be reliable, or the DHO is buggy. I've never tried a CAN snoop before on this (or any) scope, but I haven't really hard any reports of the DHO's not playing nice with CAN. I guess a third option is that I somehow tapped into entirely the wrong thing and am getting a valid differential signal pair that isn't CAN but I doubt it. This is the same socket that aftermarket CAN bus accessory controllers plug into on my bike.

I'll do up a video later after work and maybe someone can just check my math visually in case I'm missing something supremely obvious.

I don't have ready access to another CAN source that I can easily try. I mean I could try my car but I don't feel like pulling panels or digging to see if my ODB port exposes CAN. I do have some CAN breakout transceivers that I can hook to a spare ESP so I might try just generating some traffic to see if the scope plays well with that or not.

some kinda jackal fucked around with this message at 11:49 on Mar 20, 2024

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Okay slow down.

You can see a voltage signal? Then you should be able to trigger on it. There's nothing conceptually different about CAN than anything else.

I don't know how decoding works on that scope, but I would hazard a guess that full packets are too long for it.


Personally, I'd feed the signal into one of your CAN modules and then either read the UART output from that with a logic analyzer

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
I agree with getting a logic analyzer. The data will be easier to work with on a computer.

some kinda jackal
Feb 25, 2003

 
 
My guess is that CAN triggering takes the frames into account because then yeah, I agree, I'm not sure how else it would differ from edge triggering.

Basically this, but on a newer scope:

https://www.youtube.com/watch?v=METmiiieV6Y

And yeah, I fully agree. This was just me being excited to finally have a scope that can do decoding and leaving the exercise scratching my head. If I decide to do anything with the CAN messages for real I'll be doing it with an ESP and transceiver board, I just hadn't gone to the trouble of moving my breadboard setup to the cold garage and stringing wires around :)

some kinda jackal fucked around with this message at 17:01 on Mar 20, 2024

The Wonder Weapon
Dec 16, 2006



mobby_6kl posted:

:doh: I am, but this is just in the example I copied from the curl test, in the actual code I had real valid json

Did you test the new strip before cutting & soldering it? It seems to be joined properly but they can be sensitive to a good connection.

If you have a multimeter you could test either the controller output, or the LEDs on the strip directly.

I didn't test it because I didn't want to unwind 45ft worth of LED strip.

I do have some multimeters, but I use them pretty infrequently. If I wanted to test the diodes, would I test across these pairs? What setting on the multimeter am I using? The one that beeps when there's a connection?

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
If your meter has a diode tester, use that.

mobby_6kl
Aug 9, 2009

by Fluffdaddy
Yeah, if the leds don't light up, try swapping positive/negative sides.

If you don't have diode mode, you can measure voltage at those copper pads. You should be seeing something when the controller is connected and turned on.

LED strips are pretty basic stuff and generally works, so my guess would be something weird with the controller thing.

kid sinister
Nov 16, 2002
Wait, what color LEDs? Because some of those diode tests only go up to 3 volts and white LEDs are around 3.5 volts.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Modern whites will light up at 2.8, albeit dimly

ryanrs
Jul 12, 2011

There's a sewage pipe in my apartment complex parking structure that sometimes leaks. Setting aside the availability of commercial leak sensors, how would I design my own sewage detector?

I am thinking of using a conductive sensor, like a pcb with alternating exposed fingers, and measuring the resistance. I'd like the sensor pcb to be totally passive, sitting on the end of 50 ft twisted pair. I'm worried about 60 hz pickup swamping my high impedance resistance measurement.

I don't know how conductive sewage is, so I'm hoping to build a sensor with decent dynamic range, and have thresholds set in software.


LND150s are input protection. I guess I need to add some TVSes for ESD.
ADC does a 12-bit differential measurement.

Will C16 help filter out noise?

Is this circuit actually balanced in a way that makes differential measurement useful?

Should I sample continuously at ~kHz and use DSP math to filter out 60 Hz?

Maybe use a fancy delta sigma ADC that notches 60 Hz internally?

Or I guess stick an op-amp or something on the sensor board?

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Add more colloidal silver into your diet to make sure the sewage has enough conductivity

Other than that, you seem to be fixated on optimisation before you have enough data to know that you need it

ryanrs
Jul 12, 2011

I don't know that I need it. But I'm only building one device and it'd be nice if it worked the first time.

Are you saying that you think 60 Hz noise is not likely to be an issue here?

Hexyflexy
Sep 2, 2011

asymptotically approaching one
Bosch got you covered with a sniffer chip

https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme688-ds000.pdf

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Sewage is extremely conductive. Just a couple of wires alone with 120VAC and a light bulb works as a detector.

Or, like, anything.

It's tap water (conductive) with electrolytes added.

Sagebrush
Feb 26, 2012

ryanrs posted:

Setting aside the availability of commercial leak sensors, how would I design my own sewage detector?

This is a pretty effective system.

LimaBiker
Dec 9, 2020




Design it in such a way that you don't get A. electrolysis (results in rapid electrode wear) or electroplating (results sometimes in a spurious bias voltage from it working as an electrochemical cell) from the measurement current. This means using an AC voltage to feed the sensor.
And B. use corrosion resistant materials. Gold plated PCB is an option. Very traditional carbon rods also hold out quite nicely.

If you use a known AC measurement frequency like 1kHz you can quite nicely filter that one frequency out and avoid all 60hz + harmonics interference.

LimaBiker fucked around with this message at 23:56 on Mar 22, 2024

ryanrs
Jul 12, 2011

Gonna minimize electrolysis by briefly energizing it every 10 minutes or so. And it should spend 99.9% of its life not coated in sewage.

(I was going to say 99.99%, but that's too optimistic.)

ryanrs
Jul 12, 2011

I do like the idea of a steampunk sewage detector that just runs straight 120VAC to big carbon electrodes. A red incandescent POOP sign glows when a leak is detected.

The bulb flickers as a gob of poo poo oozes off the electrodes.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


ryanrs posted:

I do like the idea of a steampunk sewage detector that just runs straight 120VAC to big carbon electrodes. A red incandescent POOP sign glows when a leak is detected.

The bulb flickers as a gob of poo poo oozes off the electrodes.

If by "steampunk" you mean "still a new-construction device available for purchase until the 1990s" then sure. I got to remove one at a wastewater treatment plant. It was the backup to the backup high-level alarm. 120V isolation transformer, couple of stainless electrodes, and a big buzzer in a box with a big incandescent light.

ryanrs
Jul 12, 2011

lol the existence of such savagery justifies my quad LND150 protection mosfets

my design is more like an e-meter for detecting toilet thetans

kid sinister
Nov 16, 2002

ryanrs posted:

I do like the idea of a steampunk sewage detector that just runs straight 120VAC to big carbon electrodes. A red incandescent POOP sign glows when a leak is detected.

The bulb flickers as a gob of poo poo oozes off the electrodes.

This thing is gonna electrocute anyone that steps in the puddle, isn't it?

ryanrs
Jul 12, 2011

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
You can tell if there is a sewage leak by checking the apartment's bulletin board for missing person flyers.

ANIME AKBAR
Jan 25, 2007

afu~

Ambrose Burnside posted:

A buddy of mine seems dead-set on loving around with high-voltage plasma stuff, low current (he says 20mA or less) but i'm pretty sure that's not of comfort to the human heart at 5k-20KV. using one of those purpose-made HV adjustable bench supplies. can anyone provide/recommend a concise safety guide or series of rules i can deliver to him, couple minutes talking or less, that is specifically tailored towards preventing him from dying in this endeavour. I know its a very bad idea but I can't articulate the harm reduction crash-course that will prevent him from ending up in series across his heart with the bench supply

I'm curious where the 20mA number comes from. If they just googled for human body resistance and applied ohms law, then lol.

ryanrs
Jul 12, 2011

Your rear end is not an ideal resistor.

Skin and body resistance is non-linear, affording you extra protection at low voltages. But once you start getting close to 100V, your resistance drops and current goes up more quickly than linear.

e: a neat table on wikipedia

ryanrs fucked around with this message at 18:17 on Mar 23, 2024

Skinnymansbeerbelly
Apr 1, 2010
Any suggestions for a sensor that can detect the smell of hot engine in a garage?

csammis
Aug 26, 2003

Mental Institution
What is it you actually want to sense? Exhaust fumes? The sound of a running engine? How recently a vehicle arrived (which could be a function of engine block temperature)?

LimaBiker
Dec 9, 2020




Smell? Quite hard.

Actual temperature? Much easier with an infrared thermometer pointed at the spot where the engine will most likely be. Thermal imaging if you wanna be real fancy.

ryanrs
Jul 12, 2011

The Bosch sensor linked upthread might detect a car from the exhaust.

Melexis MLX90640 is a $75 IR imaging sensor. It's a calibrated 32x24 pixel array, with the pixel values corresponding directly to temperature +/- 2 deg C. It would be very easy for a microcontroller to e.g. detect a blob that's +10 C over surrounding temps. It connects using I2C and is very well suited to Arduinos, Teensy, Raspberry Pico, and other tiny controllers.

e: A 0.0008 megapixel selfie

ryanrs fucked around with this message at 20:29 on Mar 24, 2024

Skinnymansbeerbelly
Apr 1, 2010
The background is that I have an air purifier which is pretty good at keeping the smell of hot car from intruding into my kitchen, if I run it for a while after parking my car in the attached garage. I'd like to automate that.

I was hoping to get a sensor that I could just slam onto the ESP32-C6-EVB which I plan to attach to my old-fashioned dry-contact garage door opener, because to do that with the 90640 I have to drag the I2C bus across the ceiling.

Adbot
ADBOT LOVES YOU

Shame Boy
Mar 2, 2010

Skinnymansbeerbelly posted:

The background is that I have an air purifier which is pretty good at keeping the smell of hot car from intruding into my kitchen, if I run it for a while after parking my car in the attached garage. I'd like to automate that.

I was hoping to get a sensor that I could just slam onto the ESP32-C6-EVB which I plan to attach to my old-fashioned dry-contact garage door opener, because to do that with the 90640 I have to drag the I2C bus across the ceiling.

You'd need to know what kind of vapors that smell is made of first, but there's plenty of sensors that can detect basic molecules like CO concentration or volatile organic compounds or something like that that might work :shrug:

Or just like, sense the car using an electric eye sensor or whatever and then start a timer to run for an hour.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply