<badrb[m]>
Hi! Does any one have some recommendation for a modbus no_std crate?
<JamesMunns[m]>
quick question, are you being a modbus master or slave in no_std mode?
<JamesMunns[m]>
There's https://github.com/slowtec/modbus-core, but IIRC it only supported being a slave in no_std, which doesn't help if you want to talk to an external meter or something
<badrb[m]>
Master
vollbrecht[m] has joined #rust-embedded
<badrb[m]>
modbus-rtu
<vollbrecht[m]>
are you wanting modbus-rtu or modbus-tcp :D
<JamesMunns[m]>
Yeah that's a good question too, I was assuming rti
<JamesMunns[m]>
s/rti/rtu/
<JamesMunns[m]>
yeah, modbus-core::rtu only provides slave/server, not master/client
<JamesMunns[m]>
I found that in a project recently, I think I ended up hacking together a basic master/client library by using some of the bits from tokio-modbus and modbus-core, but it wasn't a general solution, I basically implemented enough to talk to the three slave/server nodes I needed for that project
<JamesMunns[m]>
maybe someone else knows of a better solution
<vollbrecht[m]>
rmodbus claims no_std support but just from reading
<badrb[m]>
I was surprised to not find much in the no_std realm, Modbus is fairly common.
<diondokter[m]>
I've used it as both a server and a client
<JamesMunns[m]>
tokio-modbus I've seen at a couple customers, but they are all on PCs talking to external sensors/actuators
<badrb[m]>
JamesMunns[m]: Do you have sources published? It might be a good inspiration
<JamesMunns[m]>
badrb[m]: no, sorry, that was a private customer project
<badrb[m]>
Thanks guys, I’ll take a look at rmodbus!
<diondokter[m]>
Here's my server code for rmodbus. It's flexible enough that I could put an async layer on top of it. Though, that's not really required to use, it was more to challenge myself 😬
<FlixtheNewbie[m]>
I know that if we take only the array into account, the first one is bigger, but if I use a reference to Foo::Nothing, what space does it take? A full Foo size, or just one byte?
<FlixtheNewbie[m]>
If the latter takes less space, how costly is such a series of indirections when I iterate over the array?
<FlixtheNewbie[m]>
* the array on the FLASH?
burrbull[m] has joined #rust-embedded
<burrbull[m]>
<FlixtheNewbie[m]> "I know that if we take only..." <- `size_of<ref> == size_of<usize>` 4 bytes for 32bit system
<vollbrecht[m]>
dirbaio: didn't you want to release embedded-hal on gh? its still missing the gh release
thejpster[m] has joined #rust-embedded
<thejpster[m]>
consts take zero space - they are pasted into the usage site at compile time.
<thejpster[m]>
But Foo is 132 bytes and &Foo is 4 or 8 bytes (depending on platform). I suspect you’d get a single static Foo with the value Nothing and all the references would point to it.
<thejpster[m]>
Indirections are low cost unless you have cache. You’d have to benchmark your application, but personally I wouldn’t worry about it until performance had been proven to be outside acceptable limits.
KarthiR[m] has quit [Quit: Idle timeout reached: 172800s]
Guest7282 has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
jessebraham[m] has quit [Quit: Idle timeout reached: 172800s]
Guest7282 has left #rust-embedded [Error from remote client]
Guest7282 has joined #rust-embedded
<dav1d>
If I want to pass messages between embassy tasks, is the way to do it with a 'static Channel?
Guest7282 has left #rust-embedded [Error from remote client]
<diondokter[m]>
<dav1d> "If I want to pass messages..." <- yes indeed! If you look at e.g. embassy-sync, then you'll see multiple flavours of channels. One of those will surely work for you
<dav1d>
diondokter[m], cool thanks, wasnt sure if I have to make them static or if I can pass references
<diondokter[m]>
To pass something to an embassy task, it needs to be 'static, so yes
Guest7282 has joined #rust-embedded
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
<FlixtheNewbie[m]>
<thejpster[m]> "Indirections are low cost unless..." <- Thanks a lot, that's clear. I'll use the reference mechanism, then, I will be able to save a lot of space.
IlPalazzo-ojiisa has quit [Ping timeout: 264 seconds]
ryan-summers[m] has quit [Quit: Idle timeout reached: 172800s]
starblue has quit [Ping timeout: 256 seconds]
kenny has quit [Quit: WeeChat 4.1.1]
starblue has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
bartmassey[m] has quit [Quit: Idle timeout reached: 172800s]
spinfast[m] has quit [Quit: Idle timeout reached: 172800s]
GrantM11235[m] has quit [Quit: Idle timeout reached: 172800s]
mameluc[m] has quit [Quit: Idle timeout reached: 172800s]
firefrommoonligh has quit [Quit: Idle timeout reached: 172800s]
dirbaio[m] has quit [Quit: Idle timeout reached: 172800s]
<dav1d>
is there something like FuturesUnordered for embedded?