• RE: Awesome tip: run LinuxFX instead of Windows!

    @skywatch said in Awesome tip: run LinuxFX instead of Windows!:

    @NeverDie So how is it going for you? Have you tried USB devices with it? Did they work well? I am thinking of being able to run Win x64 SDR software on this but still wonder if it will work - Will try it out as soon as I can and report back. Meantime any hints or opinions you have would be good if you can share.

    Sometime after I made the original post the LinuxFX people decided they wanted to charge people money for their flavor of the OS. As near as I can tell, it kinda imploded after that. So, I settled on Linux Mint (Cinnamon version), and I'm happy with it. I still use Windows for programs that are only supported to run under windows, like Fusion360, rather than try to use wine to get it to run under Linux, but for everything else Linux Mint works great. Fast, stable, and without all the sluggishness you typically get (sooner or later) with Windows.

    posted in General Discussion
  • Using chatgpt to write code for the nrf52840....

    I haven't confirmed whether the offered solution will work or not, but it took only one second to generate, so on that basis alone I'm impressed.

    Anyone here using chatgpt for actual coding of any kind?

    By way of example, I gave this prompt:

    Without using zephyr, write a program for the nrf52840 to send a "Happy Birthday!" text message using the proprietary radio mode.
    

    and chatgpt's response was:

    To send a "Happy Birthday!" text message using the nRF52840 in proprietary radio mode without using the Zephyr RTOS, you can use Nordic Semiconductor's nRF5 SDK. Here's a basic example of how to create a custom radio communication program for the nRF52840. Please note that this code is a simplified example, and in a real-world scenario, you would implement error handling and more robust communication protocols.

    Transmitter (TX) Code:

    #include <stdint.h>
    #include <stdbool.h>
    #include "nrf.h"
    #include "nrf_gpio.h"
    
    #define RADIO_CHANNEL 76  // Choose a custom channel
    
    void radio_init(void) {
        NRF_RADIO->TXPOWER = RADIO_TXPOWER_TXPOWER_0dBm;
        NRF_RADIO->FREQUENCY = RADIO_CHANNEL;
        NRF_RADIO->MODE = RADIO_MODE_MODE_Nrf_2Mbit;
        NRF_RADIO->SHORTS = 0;
        NRF_RADIO->PCNF0 = (1 << RADIO_PCNF0_LFLEN_Pos);
        NRF_RADIO->PCNF1 = (1 << RADIO_PCNF1_WHITEEN_Pos) | (3 << RADIO_PCNF1_BALEN_Pos);
        NRF_RADIO->BASE0 = 0xE7E7E7E7;
        NRF_RADIO->BASE1 = 0x43434343;
        NRF_RADIO->PREFIX0 = 0x55443322;
        NRF_RADIO->TXADDRESS = 0x00;
        NRF_RADIO->RXADDRESSES = 0x01;
    }
    
    void radio_send(const uint8_t *data, uint8_t length) {
        NRF_RADIO->PACKETPTR = (uint32_t)data;
        NRF_RADIO->EVENTS_READY = 0;
        NRF_RADIO->EVENTS_END = 0;
    
        NRF_RADIO->TASKS_TXEN = 1;
        while (NRF_RADIO->EVENTS_READY == 0);
    
        NRF_RADIO->TASKS_START = 1;
    
        while (NRF_RADIO->EVENTS_END == 0);
        NRF_RADIO->EVENTS_END = 0;
    
        NRF_RADIO->TASKS_DISABLE = 1;
        while (NRF_RADIO->EVENTS_DISABLED == 0);
    }
    
    int main(void) {
        nrf_gpio_cfg_output(20); // LED on pin 20
    
        radio_init();
    
        while (1) {
            // Message to send
            uint8_t message[] = "Happy Birthday!";
            uint8_t message_len = sizeof(message) - 1; // Exclude null-terminator
    
            // Send the message
            radio_send(message, message_len);
    
            // Toggle an LED to indicate a transmission
            nrf_gpio_pin_toggle(20);
    
            // Delay between transmissions
            for (int i = 0; i < 1000000; i++) {
                __NOP();
            }
        }
    }
    

    Receiver (RX) Code:

    #include <stdint.h>
    #include <stdbool.h>
    #include "nrf.h"
    #include "nrf_gpio.h"
    
    #define RADIO_CHANNEL 76  // Should match the transmitter's channel
    
    void radio_init(void) {
        NRF_RADIO->TXPOWER = RADIO_TXPOWER_TXPOWER_0dBm;
        NRF_RADIO->FREQUENCY = RADIO_CHANNEL;
        NRF_RADIO->MODE = RADIO_MODE_MODE_Nrf_2Mbit;
        NRF_RADIO->SHORTS = 0;
        NRF_RADIO->PCNF0 = (1 << RADIO_PCNF0_LFLEN_Pos);
        NRF_RADIO->PCNF1 = (1 << RADIO_PCNF1_WHITEEN_Pos) | (3 << RADIO_PCNF1_BALEN_Pos);
        NRF_RADIO->BASE0 = 0xE7E7E7E7;
        NRF_RADIO->BASE1 = 0x43434343;
        NRF_RADIO->PREFIX0 = 0x55443322;
        NRF_RADIO->TXADDRESS = 0x00;
        NRF_RADIO->RXADDRESSES = 0x01;
    }
    
    void radio_receive(uint8_t *data, uint8_t *length) {
        NRF_RADIO->PACKETPTR = (uint32_t)data;
        NRF_RADIO->EVENTS_READY = 0;
        NRF_RADIO->EVENTS_END = 0;
    
        NRF_RADIO->TASKS_RXEN = 1;
        while (NRF_RADIO->EVENTS_READY == 0);
    
        NRF_RADIO->TASKS_START = 1;
    
        while (NRF_RADIO->EVENTS_END == 0);
        NRF_RADIO->EVENTS_END = 0;
    
        NRF_RADIO->TASKS_DISABLE = 1;
        while (NRF_RADIO->EVENTS_DISABLED == 0);
    
        *length = NRF_RADIO->RXMATCH;
    }
    
    int main(void) {
        nrf_gpio_cfg_output(20); // LED on pin 20
    
        radio_init();
    
        while (1) {
            uint8_t message[16]; // Adjust the buffer size as needed
            uint8_t message_len = 0;
    
            // Receive a message
            radio_receive(message, &message_len);
    
            // Toggle an LED to indicate a reception
            nrf_gpio_pin_toggle(20);
    
            // Process the received message (e.g., print it)
            if (message_len > 0) {
                message[message_len] = '\0'; // Null-terminate the received data
                printf("Received: %s\n", message);
            }
        }
    }
    

    This code sets up a transmitter (TX) and receiver (RX) using the nRF52840's radio peripheral. The TX repeatedly sends the "Happy Birthday!" message, and the RX receives and prints any incoming messages. Make sure both devices are configured to use the same radio channel and have matching radio settings.

    Remember to adapt this code to your specific hardware setup and application requirements, and consider adding more robust error handling for a production-quality solution.

    posted in General Discussion
  • RE: Which one should i choose? PIR or microwave sensor

    Supposedly PIR doesn't work through glass (e.g. if looking for motion through a window), whereas I presume a microwave sensor might still work.

    posted in Hardware
  • RE: Anyone using/tried the E28-2G4M27S 2.4Ghz LoRa SX1280 27dB module?

    ^^^This. Good point. Maybe do some testing with RadioLib to see whether or not you experience the same problem.

    posted in General Discussion
  • Looks as though the raspberry pi pico will provide 16-bit PWM duty-cycle resolution

    Contrast that 65535 step resolution to the 255 step duty-cycle resolution on Arduino's, and that is a big improvement for control of, say, a DIY DC-DC converter. For instance, if you want to build your own DIY solar MPPT boost converter (good luck finding one to buy in the commercial market. Probably 99%+ of those are step-down MPPT controllers, with only a rare bird being a step-up MPPT controller). The pi pico's are just $4 each at mouser and Adaruit ( https://www.adafruit.com/product/4864 ) for the genuine article, not some sketchy knock-off. Just thought I'd mention it, as I think most people aren't aware of it. I'm not sure whether or not a more stripped down version of the pi pico would consume significantly less current. If so, then it might be quite compelling: a fully formed pi pico board for $4 vs. an atmega328p chip alone for $3 (note: as a reference, these are present market prices on mouser).

    posted in General Discussion
  • RE: Anyone using/tried the E28-2G4M27S 2.4Ghz LoRa SX1280 27dB module?

    @haxn2 I don't recall there being any problems of the type you describe. You didn't say what kind of "trouble" you were having, but, if anything, the high coding factor and narrow bandwidth should improve range, unless there is interference in the narrower band. Have you tried changing the frequency? Are you sure you're using a suitable antenna? Exactly what kind of range are you trying to achieve?

    posted in General Discussion
  • RE: Coronavirus (way, way, off topic)

    I don't know what guidance is being given in other countries, but here in the US the CDC is still endorsing the use of cloth masks, even now 3 years into this debacle:
    https://www.cdc.gov/coronavirus/2019-ncov/prevent-getting-sick/types-of-masks.html

    At the grocery store and other retail, I still see some people wearing cloth masks....

    posted in General Discussion
  • RE: Coronavirus (way, way, off topic)

    Worthy of note:
    Masks, no evidence they work – 14:59
    — Dr. John Campbell

    TL;DR: It turns out that masking had essentially no efficacy. 🤦 It blows my mind. How can it be that the mainstream got so much so wrong for so long about covid? And, more importantly, what should we have done instead?

    posted in General Discussion
  • RE: Anyone using/tried the E28-2G4M27S 2.4Ghz LoRa SX1280 27dB module?

    @SMH17 said in Anyone using/tried the E28-2G4M27S 2.4Ghz LoRa SX1280 27dB module?:

    @NeverDie I have noticed that in the latest version of your adapter you have lowered the capacitor value used for the first stage filtering from 100uF to 10uF, leaving the second stage one to 0.1uF. Did you have empirical benefit in tests with this configuration? 0.1uF it seems to me at first glance too small to accommodate current draw fluctuation of this module. Would be appreciated if you explain your design choice. Thank you.

    The 10uF isn't for filtering. It's just to prevent voltage droop at the radio when the radio starts to pull current. So, yes, testing reveals that it seems adequate for that purpose. I originally slotted in 100uF because I wasn't sure, and overkill is better than underkill. It's possible that 10uF may also be overkill....

    posted in General Discussion
  • RE: Best 3d printers

    Reporting back: I have my BambuLab X1C printer setup and have printed with it for about a week. It's fantastic: it's fast, and the prints come out perfectly every time. Truly an appliance: it works with only minor setup straight out of the box. I'd say it's a quantum leap better than my Prusa MK3S, which I guess I should try to sell while it still has value.

    posted in Enclosures / 3D Printing