Help Bites



  • @Bulb said in Help Bites:

    You need to think about MTU at the network layer if you care about latency, i.e. you are sending a lot of smallish chunks and care about them reaching the destination quickly. But if you have a large payload to stream and you need to stream all of it, you just throw it at the network stack and let the network stack chop it up as it sees fit

    Yes - I mainly mentioned those to provide a lower bound. Going below that doesn't make much sense (though it might also not be that terrible on something like TCP; the standard-ish TCP implementations also doesn't require you to decide on a message size...).

    I don't think it much matters after that .. 10s of kB is probably fine. If you can spare the memory, a few MB or more is fine.

    I think the main message is: don't worry too much. Select a sufficiently large size. Roll with it.



  • And add a TODO: optimize this later if that makes you sleep better at night.



  • @Bulb said in Help Bites:

    You need to think about [whatever]

    But that's the thing, I don't want to have to think about things I don't have any clue about!

    (this is getting way out of a simple "help" question, and turning into a rant, but since I'm the one who asked, I don't feel any guilt in derailing it)

    Yes, yes, you could probably make an argument that if I'm using a library to do X then I should learn how to do X and if that means setting some special parameters, I should learn about it. And you have a point, blindly calling into a library without having a clue as to what it does it not a good idea, to put it mildly. But the point of using a library rather than reinventing the wheel is to avoid having to think about all those nitty-gritty details. And now we're getting into the "leaky abstraction" thing -- that always happens, yes, as this example shows, but that still doesn't make it a good thing when that happens, on the contrary.

    This is one of the things I dislike with a lot of neural network stuff. To get it to work you have to set some values of something or some other thing (number of neurons, layers, activation functions and what-not) and as someone tackling whatever domain-specific problem I'm looking at, I don't have the slightest clue as to what those are.

    I've read many, many papers in my domain where people show how to get some result with a NN and there's always this part where they describe the setup of the thing and there is never any justification as to why they used n rather than n+1 for this parameter -- at best it's pure cargo-cult "we're reusing the values used by Smith & Smith as it worked for them."

    Anyway. Moving on.



  • @remi said in Help Bites:

    there is never any justification as to why they used n rather than n+1 for this parameter

    I'm betting that in a lot of cases, the answer is either "the default parameters worked, so we didn't look further into it" or "the default parameters didn't work, so we randomly tweaked their values until they did".



  • @remi said in Help Bites:

    @Bulb said in Help Bites:

    You need to think about [whatever]

    But that's the thing, I don't want to have to think about things I don't have any clue about!

    Which is fine, because I said you don't need to think about it (expect in some case that ain't your case).


  • Discourse touched me in a no-no place

    @Zerosquare said in Help Bites:

    @remi said in Help Bites:

    there is never any justification as to why they used n rather than n+1 for this parameter

    I'm betting that in a lot of cases, the answer is either "the default parameters worked, so we didn't look further into it" or "the default parameters didn't work, so we randomly tweaked their values until they did".

    IIRC, as the number of layers goes up, the difficulty of getting the training right goes up too. These things find all the patterns that are there, not just the ones you want; using more layers allows more complexity of patterns, and so increases the chance of something unexpected making everything behave unexpectedly...



  • I'm about to ask another question on an absolutely not related topic so first some closure on the previous one, in the vain hope that it'll stop that discussion:

    In the end I hard-coded the size of messages, to 4 MB (i.e. the same as the library default value), when I start the server (in the C++ code). Then the rest of the C++ code can trivially get this size (I stored it somewhere that my code can access).

    The only complication that I hadn't thought about was that I also need to pass the same size when I open a channel to the server (from the Python side). I could have hard-coded it again in the Python code, but instead I decided to be a bit smarter (or :wtf:er?). I added a request to the server to get the size (that one was trivial to implement), and now when I open a channel I first open it with the default size, then send this request to get the proper size, then close the channel and reopen a new one with the correct size.

    This way if we ever want to change the size, there is only one place where it's hard-coded.

    Job done. :shipit: and wait for bug reports to do something (or nothing :kneeling_warthog:).



  • So that other question, totally unrelated. It's about DIY, no computer or electronics (or even electricity) involved.

    I have a cooking dish (for stuff that goes in the oven, think... I don't know, mac & cheese?) with two small handles. Something like this:
    4c390740-22b5-4481-9797-a94a0bbdddfe-image.png
    We use it a lot and as a result both handles are chipped. Nothing that prevents using it, just the usual wear & tear. But this being glass, the broken bits are quite sharp -- and what provoked me to post here is that the other day I got a nasty cut while cleaning it.

    Now I could just throw it away and buy a new one. It's not particularly valuable, financially or sentimentally or otherwise.

    But first I'm wondering if there is an easy way to smooth out the edges?

    If it was wood I'd just sand it. If it was metal I could also file it. But I don't know how to work glass? It's not particularly fragile (it's not cristal or anything like it) but it's obviously glass. Obviously regular sandpaper isn't going to get me anywhere. I have an angle grinder but also obviously the likelihood of shattering the glass is pretty high.

    So, without buying some specialist tools, is there anything I can use to sand it and just round a bit the cutting edge?



  • @remi said in Help Bites:

    it's obviously glass. Obviously regular sandpaper isn't going to get me anywhere.

    Why not? The abrasive used for sandpaper is much harder than glass. Some fine sandpaper should smooth the sharp edges with no difficulty at all. I'd start with maybe 220 grit wet-or-dry and finish with maybe 400 or 600, with intermediate grits as necessary. Probably no real need to go finer that that, although you certainly could if you wanted to, all the way to a high polish.

    An alternative would be to fire-polish it. I wouldn't try that, though. Presumably, it's borosilicate (low thermal expansion) glass, but there's still risk of shattering it from uneven heating.


  • Discourse touched me in a no-no place

    @HardwareGeek said in Help Bites:

    Why not? The abrasive used for sandpaper is much harder than glass.

    Silicon carbide sandpaper yes, aluminium carbideoxide sandpaper no.



  • @loopback0 said in Help Bites:

    aluminium carbide sandpaper

    I'd never heard of that. It seems like a poor choice, since alumin[i]um carbide reacts with water to form methane.

    Regardless of that, however, according to the most reliable repository of human knowledge, its hardness is "similar to topaz", which is the definition of Mohs hardness 8. Glass, in contrast, typically has a hardness of about 5.5. I wouldn't be surprised if borosilicate glass is a little harder, but I'd be very surprised if it's anywhere near 8.


  • Discourse touched me in a no-no place

    @HardwareGeek Oops. That should have said aluminium oxide sandpaper, which is useless on glass.



  • @loopback0 said in Help Bites:

    @HardwareGeek Oops. That should have said aluminium oxide sandpaper.

    Aluminum oxide is the definition of hardness 9, even harder than topaz/aluminum carbide. I'm not sure, without looking it up, what the hardness of silicon carbide is, but it's somewhat harder still; it can be used to grind aluminum oxide.



  • @HardwareGeek said in Help Bites:

    Why not? The abrasive used for sandpaper is much harder than glass. Some fine sandpaper should smooth the sharp edges with no difficulty at all.

    Mmm... my stash of sandpaper sounds far too flimsy to work, in particular because the paper itself on which the sand is (if that makes sense...) looks a lot like some sort of paper that'll get teared immediately. But then again, I didn't try, so maybe it'll work. And this batch is just some cheap assorted various grains sandpaper (good enough for random small jobs but certainly not good quality), so maybe what I need is just to get one sheet of good (better) quality sandpaper.

    Based on the other answer I'm thinking I also need to make sure it's the right stuff, which also probably means not the cheapest stuff, no big surprise here. I'll give it a try with what I have in my workshop and then most likely I'll see what my hardware store has.

    I did a quick search and the annoying thing is that in French "sandpaper" is called "papier de verre" i.e. literally "glass paper" (probably because the bits of sand sometimes look like small shiny fragments of glass?). You can imagine how successful searching for "glass paper for glass" on hardware stores is... 😠

    Thanks!



  • Looks like you need silicon carbide paper, indeed:

    Some interesting info here:



  • @Gąska said in Help Bites:

    Edit: as for stripping, I don't know the .Net toolchain very well, but considering that you can call object's private method through reflection, it's possible nothing ever gets stripped from classes so the ugly hacks like that don't randomly break down based on dead code analysis.

    Fun times with Android, when people insist in using the damn obfuscator that strip things that are used only with reflection, so you have to remember to put them manually in a exclusion list. Combine this with folks that think OMG that's hardcoded, so they put the classname in a xml file that is totally different from hardcoding for reasons



  • @remi said in Help Bites:

    Obviously regular sandpaper isn't going to get me anywhere.

    So, obviously regular sandpaper did get me somewhere, namely to a smoothed out dish. 👍

    Well, smooth-ish because I got bored pretty quickly and called it a day as soon as it wasn't too sharp anymore. Also the sandpaper got worn pretty quickly, but as I already said that's probably because it's cheap low quality sandpaper. At this point, I don't care, I shouldn't cut myself anymore so mission accomplished.


  • Notification Spam Recipient

    Status: I hate that it's not clear how this stupid chip is to be connected.

    I have an ESP32 board with an addon display thingy, its' pinout is like so:

    s-l1600.webp

    I have a NFR24L01, with a pinout ostensibly like so:

    NRF24L01-Pinout-NRF24L01-PA-LNA--768x512.webp

    The most-clear pin connection diagram I can find looks like shit:

    NRF24L01-and-Arduino-Tutorial-Circuit-Schematic-768x430.webp

    I believe I have translated the connections appropriately as follows (from the NRF to ESP32):

    1. GND
    2. GPIO2
    3. GPIO14 (aka HSPI_SCK)
    4. GPIO12 (aka HSPI_MISO
    5. NC
    6. GPIO13 (aka HSPI_MOSI)
    7. GPIO27
    8. 3.3V

    I imported the RF24 library and threw in the demo code (which seems to not have any way to verify chip communications?!?!) and it compiles and runs, but.... I can't seem to verify if it's working or not.

    There's a library function printDetails that shits out the apparent current config but it seems to be all nulls down the line:

    [    14][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
    SPI Speedz	= 10 Mhz
    STATUS		= 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
    RX_ADDR_P0-1	= 0x0000000000 0x0000000000
    RX_ADDR_P2-5	= 0x00 0x00 0x00 0x00
    TX_ADDR		= 0x0000000000
    RX_PW_P0-6	= 0x00 0x00 0x00 0x00 0x00 0x00
    EN_AA		= 0x00
    EN_RXADDR	= 0x00
    RF_CH		= 0xff
    RF_SETUP	= 0xff
    CONFIG		= 0xff
    DYNPD/FEATURE	= 0xff 0xff
    Data Rate	= 1 MBPS
    Model		= nRF24L01+
    CRC Length	= 16 bits
    PA Power	= PA_MIN
    ARC		= 0
    

    Any ideas? Did I interpret the ugly diagram incorrectly or is this normal?



  • Hard to tell without knowing what the RF24 library expects. There's no mention in the documentation or source code of which pins are used?

    Your ESP32 board image mentions something about SPI signals being routable to any GPIO pins, so it may be necessary to configure that part as well.

    Also:

    • what are you trying to communicate with? You can't really test a radio chip by itself, without something to send to / receive from.
    • what kind of hardware diagnostic tools (oscilloscope, logic analyzer, etc.) do you have?

  • Notification Spam Recipient

    @Tsaukpaetra said in Help Bites:

    Any ideas? Did I interpret the ugly diagram incorrectly or is this normal?

    Ah, documentation seems to indicate the default SPI is using the VSPI pins, for raisins.
    Manually specifying the HSPI pins with SPI.begin(14, 12, 13, 15); made it Just Work. :headdesk:


  • Notification Spam Recipient

    @Zerosquare said in Help Bites:

    Hard to tell without knowing what the RF24 library expects. There's no mention in the documentation or source code of which pins are used?

    Yeah I guess it just uses the default, unless you instantiate an SPI object and pass it in as a pointer in a particular mode? I didn't bother messing with it very far.

    @Zerosquare said in Help Bites:

    what are you trying to communicate with? You can't really test a radio chip by itself, without something to send to / receive from.

    I should be able to configure things and have the chip read back that configuration. That's the very first step.

    @Zerosquare said in Help Bites:

    what kind of hardware diagnostic tools (oscilloscope, logic analyzer, etc.) do you have?

    At the moment just my noggin, all my electronics shit is all over the place in inconvenient storage.


Log in to reply