ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to and logged at, code of conduct at
KevinLy[m] has quit [Quit: Idle timeout reached: 172800s]
bomb has joined #rust-embedded
sneakernet[m] has quit [Quit: Idle timeout reached: 172800s]
<jannic[m]> I'd say that API isn't great. Having to read the PAC docs to understand the HAL shouldn't be necessary. We should at least improve the docs on the pull function. Even better if we could find a more obvious API. Perhaps the pull function should do what try_pull does now? And for cases where every cycle counts, have a pull_unchecked that may return stale data like pull does now.
<Socke> anyone here using neovim + rust-analyzer for development? a while ago, my setup stopped working with my esp32c3 projects. basically I could see no more inlay hints, compile results etc in nvim. was using rust-tools.nvim at that time. since the setup had some other issues, I decided to re-do it over the weekend and switched to LazyVim. but still have the same problem. everything works fine on
<Socke> x86-64, but once I go to a project with target = "riscv32imc-esp-espidf" in .cargo/config.toml, things stop working
<Socke> for testing, I just run `cargo generate esp-rs/esp-idf-template` then `cargo check` and after it builds I open nvim and load after I add some line like `let foo = bar;` which should obviously show some errors, I still see nothing.
<Socke> when I run :RustLsp logFile, I get the following log:
Kaspar[m] has quit [Quit: Idle timeout reached: 172800s]
<Socke> hmm finally found something. looks like this is a known problem: and
<Socke> btw, I'm getting the same error when running `cargo check --tests`
<Socke> lol the mentioned workaround even works o.O
TimSmall[m] has quit [Quit: Idle timeout reached: 172800s]
<Socke> found a workaround that does not require patching the source. see my last comment in the rust-analyzer issue :)
mali[m] has quit [Quit: Idle timeout reached: 172800s]
AtleoS has joined #rust-embedded
<AdamHott[m]> I've got these M5Stack servos connected to an esp32c3, they're getting power from the battery because when I connected the positive terminal they all jumped a little bit. I'm trying to figure out why the PWM isn't controlling them properly.... (full message at <>)
<vollbrecht[m]> are you only connecting the pwm pin itself to the outputs? E.g you dont connect any ground pin from the esp to your drivers in any form? Be aware that your ground potential from your esp / notebook can be hundreds of volts different to your batterie ground potential
<AdamHott[m]> Right now I only have the PWM pin to the data line on the servos. The power and ground are coming from the battery.
<AdamHott[m]> I have a step-down voltage converter connected between the battery and the junction box.
<vollbrecht[m]> you have to think about grounds here. How do you think the esp knows what is 3.3V and what is 0 Volt. And how does your motor drivers now what voltage the pwm is relative to. A voltage is only ever meaningful if you define its potential between two points. ( defining can be done by forcing for example grounds together with a connection, otherwise you can think of it like "UNDEFINED BEHAVIOUR" of your electrical system ;D )
<AdamHott[m]> ah crud yes that makes sense
<AdamHott[m]> what would you recommend I do here?
<vollbrecht[m]> but be aware, that can be potential dangoures, as in the short moment you force to things together to the same potential they may be big access currents running. ( Think ESD events )
<vollbrecht[m]> Not dangerous for you mostly but your components ;D
<vollbrecht[m]> if your notebook is not connected to power, you can think about the minus poill of your notebook batterie and the minus poll of the external batteries are not the same.
<vollbrecht[m]> s/poill/poll/
<vollbrecht[m]> s/poill/poll/, s/./ if they are not connected in some way/
<vollbrecht[m]> s/poill/pole/, s/poll/pole/, s/./ if they are not connected in some way/
<AdamHott[m]> What lines need to be connected from the servos to the esp32c3 other than the data line?
<AdamHott[m]> And how does my battery fit into this?
<AdamHott[m]> I'm lucky I didn't destroy everything honestly
<AdamHott[m]> I disconnected everything
<vollbrecht[m]> if you have a Handheld Multimeter that is not connected to gnd, you can measure the minus pole of your Batterie(or better the negative of your input to one of your drivers) and a ground pin of the esp. This needs to be 0 volts. You get there by connecting this two planes somehow.
<vollbrecht[m]> * connected to earth gnd, you
<JamesMunns[m]> Yeah, in general in 99% of circuits, you need to have the grounds connected together, so the ground of your battery with the ground of your laptop and MCU.
<AdamHott[m]> ok, I'll try to sketch this circuit out and come back with it, if that's okay?
<AdamHott[m]> thanks!
<vollbrecht[m]> in simplified terms you could also think of it that way: If you only connect the pwm pin, where should the current flow backwards to the esp.
<dav1d> If my esp is drawing power from a socket do I run any risk if I connect my laptop via USB to flash? Or should I unplug the esp from the socket first?
<AdamHott[m]> good point
<vollbrecht[m]> * in simplified terms you could also think of it that way: If you only connect the pwm pin, where should the current flow backwards to the esp to complete the circuit
<JamesMunns[m]> in general you don't want to provide power (e.g. 5v) from two places. some boards handle this for you, and make sure only one supply is working at a time, some don't and just connect it all together
<JamesMunns[m]> it wouldn't hurt to unplug and only power from your laptop, other than that you'd have to check if they have reverse protection diodes or a power path circuit
<dav1d> Aight thanks, maybe I can find a schematic of the board and see a diode
<vollbrecht[m]> and its not even just two different power supply's ;D this problem also creep up if you use your shiny oscilloscope ( that is earth referenced 99% of time) and your notebook powerd esp and have your notebook power supply connected. The power-brick often creates a virtual ground to the notebook, this often creates huge potential differences and can simply kill a oscilloscope ;D
<vollbrecht[m]> and know after i induced enough fear here. The best thing to conquer fear is education. See it as an opportunity to learn more about this stuff !!
<vollbrecht[m]> s/know/now/, s//**/, s/./**./
ChristianHeussy[ has quit [Quit: Idle timeout reached: 172800s]
RobertJrdens[m] has quit [Quit: Idle timeout reached: 172800s]
<whitequark[cis]> i once got a wire white-hot like this
<whitequark[cis]> though as i learned later, the PCB of my cheap linear power supply was designed with insufficient clearance and an overtightened philips screw cut through the solder mask and got one of the internal rails, iirc +15V, directly onto the ground lead, which was also connected to the ground prong of the plug
<whitequark[cis]> s/ground/earth/
<whitequark[cis]> s/ground/earth/, s/ground/earth/
<whitequark[cis]> so anything connected between ground of the PSU and earth of the same PSU, or earth of the scope, got instant 200 watts or something onto it
<whitequark[cis]> it was an upsetting discovery
adamgreig[m] has joined #rust-embedded
<adamgreig[m]> surprise earth return currents can be a real trip
<adamgreig[m]> i was once witness to 300kW going through the earth conductor of a regular american 10A mains flex and extension lead
<adamgreig[m]> not for long
<JamesMunns[m]> whew
<JamesMunns[m]> all devices are light emitting, once
<JamesMunns[m]> (including earth returns, I suppose lol)
<adamgreig[m]> the tech from the generator company had crossed L3 and PE over 🥲
<adamgreig[m]> yea, the copper ions were desperate to leave the outer insulation by any means necessary
<AdamHott[m]> what kind of flash did that cause?
<AdamHott[m]> big one?
<adamgreig[m]> no! honestly I didn't even see a flash, just suddenly there were holes in the outer black plastic with remnants of the inner green plastic poking through
<AdamHott[m]> wow
<AdamHott[m]> was that in an industrial setting?
diondokter[m] has quit [Quit: Idle timeout reached: 172800s]
ryan-summers[m] has quit [Quit: Idle timeout reached: 172800s]
<AdamHott[m]> Sorry for the drawing, it's bad.
<AdamHott[m]> Is this what I need to do?
<adamgreig[m]> <AdamHott[m]> "was that in an industrial..." <- yea, I don't have 300kW available at home 😅
<adamgreig[m]> not yet...
<JamesMunns[m]> Looks reasonable to me!
<AdamHott[m]> ok cool, I'll give it a shot! Schematics is more fun than I expected.
<AdamHott[m]> Ah this still doesn't work.
<AdamHott[m]> I connected the ground of my board to the ground of coming out of the voltage regulator.
<JamesMunns[m]> Might be good to try doing just one servo first, no battery, using 5v from USB?
<JamesMunns[m]> That'd cut down some of the pro lem space, imo
<AdamHott[m]> true, the esp32c3 does have a 5v rail
<AdamHott[m]> I'll try that
<adamgreig[m]> you can run a lot of servos off 7v directly too and get a bit more oomf out of them, might be worth checking the spec of your servos
<AdamHott[m]> would this be a suitable command to delete all the target directories from my eng folder? To clear up some space from all the Rust projects?
<AdamHott[m]> find /Users/hott/eng -type d -name "target" -exec rm -rf {} \;
<JamesMunns[m]> I'd PROBABLY stick to a tool like cargo sweep or cargo kondo
<AdamHott[m]> ok that sounds better, thanks I'll look into those!
<JamesMunns[m]> rm -rf SOMETHING makes me real nervous about accidentally mistyping and wiping a whole drive away :D
<AdamHott[m]> I just reinstalled my macOs because I did that on my home directory actually.... doh!
<JamesMunns[m]> heh
<JamesMunns[m]> good to learn from mistakes, if you've already paid the cost of making them!
<barnabyw[m]> sounds like time to set up backups, perhaps? time machine can be a bit clunky but it works well
<AdamHott[m]> I had everything backed up, but it's a bit of a pain to start fresh
<AdamHott[m]> Time machine sounds appealing
limpkin has quit [Quit: limpkin]
limpkin has joined #rust-embedded
GenTooMan has quit [Quit: Leaving]
cybernaut has joined #rust-embedded
cybernaut has quit [Read error: Connection reset by peer]
kenny has quit [Quit: WeeChat 4.2.1]
kenny has joined #rust-embedded
GenTooMan has joined #rust-embedded
bomb has quit [Quit: 💣]
<jannic[m]> <jannic[m]> "I'd say that API isn't great..." <-
AtleoS has quit [Ping timeout: 245 seconds]
AtleoS has joined #rust-embedded
dygear[m] has quit [Quit: Idle timeout reached: 172800s]