18 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

19 comments

  1. [5]
    spctrvl
    Link
    I'm going to try and mod one of my PSPs to run off 18650 batteries rather than the onboard one. For some background, the UMD drive on this one was broken; I got it out of a trashcan for that...

    I'm going to try and mod one of my PSPs to run off 18650 batteries rather than the onboard one. For some background, the UMD drive on this one was broken; I got it out of a trashcan for that reason. Fine for my purposes since all PSPs are rootable and can play ripped PSP games and emulated games off a memory stick (or even microsd card with an adapter).

    But after I stripped out the broken disc drive, I realized that there was now a lot of spare room in this thing, so I measured it, and the old drive bay is the perfect size to fit 4x18650 cells, with a minor bulge in the back. Since the power adapter for the PSP is 5V2A, aka standard USB battery bank, all that needs to be done is to add an off the shelf BMS, wire it to the charger jack, and it should be good. The PSP doesn't actually need the proper battery in to run as long as it's got power from the jack.

    I'm going to 3D print a new back for the thing to account for the slight bulge and add a USB C port for charging. Currently I think I'm just going to connect it to the power jack with a short cable routed externally, but if I'm ever feeling ambitious, I should be able to run the leads internally with some disassembly. If I'm ever feeling really ambitious, it should be possible to reroute the power jack to charge the 18650s, but I do still like the novelty of a PSP with a USB C port, even if it's just for charging.

    8 votes
    1. [2]
      krg
      Link Parent
      Do you have an idea of what the battery life will be like with this mod?

      Do you have an idea of what the battery life will be like with this mod?

      4 votes
      1. spctrvl
        Link Parent
        Should be 17-34 hours of gaming, since my 4x2ah cells plus the original 1.8ah add up to five and a half times stock battery capacity. Probably even more than that, since that's just multiplying...

        Should be 17-34 hours of gaming, since my 4x2ah cells plus the original 1.8ah add up to five and a half times stock battery capacity. Probably even more than that, since that's just multiplying stock numbers, while mine also has no disc drive to power and I can underclock for Gameboy and some SNES emulation, which is most of what I use it for. To be honest, I didn't even realize how ludicrous it was going to be until I ran the numbers just now, I mostly just wanted a way to use more reliable sources of standardized batteries.

        4 votes
    2. [2]
      thismachine
      Link Parent
      Is the PSP hacking and homebrew scene still alive?

      Is the PSP hacking and homebrew scene still alive?

      2 votes
      1. spctrvl
        Link Parent
        Ish? I wouldn't say it's dead, but it's pretty much mission accomplished. There's not a lot of work to be done, sony's not patching the firmware anymore, the last firmware release is completely...

        Ish? I wouldn't say it's dead, but it's pretty much mission accomplished. There's not a lot of work to be done, sony's not patching the firmware anymore, the last firmware release is completely hackable by putting some files on a memory stick, and the emulators are all pretty much as developed and stable as is possible for the hardware. Maybe N64 emulation could be brought within reach with a lot of effort optimizing, but I doubt there's interest with both the 3DS and original Switch being busted wide open.

        5 votes
  2. [6]
    skybrian
    (edited )
    Link
    A friend gave me a couple of Raspberry Pi Picos so I’ve been reading up and thinking about what to do with them. I haven’t tried anything yet but the documentation looks very good so far. Despite...

    A friend gave me a couple of Raspberry Pi Picos so I’ve been reading up and thinking about what to do with them. I haven’t tried anything yet but the documentation looks very good so far.

    Despite the name, these aren’t full-fledged tiny computers that run Linux. The Raspberry Pi Foundation is getting into microcontrollers. They made their own chip (the RP2040) with two ARM cores and 8 programmable state machines that you can use to offload I/O from the main processors. As a flex they showed how to use it to drive VGA video, but apparently that’s just a demo. There are already a variety of boards using this chip from Adafruit, Sparkfun and others.

    The Pico board itself sells for $4 and seems to be a pretty generic microcontroller board with USB 2, gpio pins, and a few ADC’s. One nice touch is that it’s designed to be either used on a breadboard or soldered onto a larger board.

    They have their own SDK that’s CMake and gcc based and seems sensibly laid out. The build uses standard GCC to generate an ELF file, which is converted to a UF2 file to load onto the device. To program it, you plug it in with a button held down and copy the U2F file to the file system it exposes. (The boot loader is in ROM so it seems like it will be difficult to screw things up permanently.) That’s the beginner’s way to do it; apparently there is a debugger protocol that can be used to flash the firmware without unplugging it and plugging it back in.

    Apparently Arduino support will be out soon, but I think it will make more sense to use the SDK directly since it looks much less complicated than Arduino.

    There’s no direct support for audio out, but apparently it can do i2s and there are third-party audio boards you can get.

    7 votes
    1. skybrian
      Link Parent
      Also, I got an email from OpenAI letting me into their beta program for GPT-3, so I kicked the tires a bit on using raw GPT-3 queries for question-answering. It doesn't seem like much has changed....

      Also, I got an email from OpenAI letting me into their beta program for GPT-3, so I kicked the tires a bit on using raw GPT-3 queries for question-answering. It doesn't seem like much has changed.

      (I had applied last summer and forgot about it.)

      2 votes
    2. [4]
      skybrian
      Link Parent
      There are at least five different ways to program a Pico board: The official C SDK. (I haven't tried it yet, but it looks nice.) The official Micropython interpreter. I tried it using the "Thonny"...

      There are at least five different ways to program a Pico board:

      • The official C SDK. (I haven't tried it yet, but it looks nice.)
      • The official Micropython interpreter. I tried it using the "Thonny" editor/debugger. It's fairly nice since you get a REPL running on the board. You can save Python files to the board, and if the file is named "main.py" it will start running on reboot. I was able to get i2c going, but stopped there because I don't want to write code to poke at registers on i2c peripherals myself. (I'm also not sure I want to use Python.)
      • The CircuitPython interpreter from AdaFruit. I assume this is useful if you like Python and want to use Adafruit's libraries for any other peripherals you get from Adafruit.
      • Arduino. Support for the Raspberry Pi Pico just came out last month.
      • PlatformIO. This seems to be an alternate build system that ties into Arduino?

      Arduino support is easy to install. Just select the Raspberry Pi Pico in Arduino's boards manager. So far, everything works much like any other Arduino board.

      Arduino support for the Raspberry Pi Pico is layered on top of MBed OS. This is a real-time OS from ARM. Presumably you could do multithreading, which seems useful since the board has two ARM cores. I've only used the Arduino API, though, which works as usual.

      So what do you really get with Arduino? Although the IDE and standard API are most visible, I think a better way to think of it is as a toolchain and package manager for microcontrollers. Every microcontroller needs its own compiler settings, maybe its own compiler, and its own standard library code, and you will likely want third-party libraries to communicate with any peripherals you attach to your board. Arduino makes it easy to download the relevant toolchain and libraries. You can compile and install code without having to think about making the toolchain work.

      You might compare with the package managers for modern languages like Go, Rust, npm, and so on. I don't know if there's any similar thing for C++ programming in general?

      In my case, I have a breakout board from AdaFruit I want to use. Writing my own driver code to communicate with it over i2c would certainly be possible, but poking registers is tedious and Adafruit already has a library for it that's available via Arduino's library manager.

      2 votes
      1. [3]
        anothersimulacrum
        Link Parent
        The package manager for C++ goes by many names, such as pacman, apt, homebrew, vcpkg (this is the closest to what you're think of) and yum :).

        You might compare with the package managers for modern languages like Go, Rust, npm, and so on. I don't know if there's any similar thing for C++ programming in general?

        The package manager for C++ goes by many names, such as pacman, apt, homebrew, vcpkg (this is the closest to what you're think of) and yum :).

        2 votes
        1. [2]
          skybrian
          Link Parent
          Unfortunately for my use case, none of these seem to be targeted at microcontrollers? Arduino looks like the only game in town. As a package manager, though, Arduino seems pretty bare-bones. It...

          Unfortunately for my use case, none of these seem to be targeted at microcontrollers? Arduino looks like the only game in town.

          As a package manager, though, Arduino seems pretty bare-bones. It doesn't seem to track version dependencies between libraries. I upgraded one library and got an obscure compile error, which was due to not upgrading an upstream library it depends on.

          Looking at Rust, I see there are projects targeting the Raspberry Pi Pico, though apparently they started without having real hardware? It looks like Adafruit is getting interested in Rust. It still looks pretty early though.

          2 votes
          1. anothersimulacrum
            Link Parent
            Yeah, and a quick run at Google doesn't get me anything looking in the right shape, so I expect library management in C++ for microcontrollers will be a fair deal of work.

            Yeah, and a quick run at Google doesn't get me anything looking in the right shape, so I expect library management in C++ for microcontrollers will be a fair deal of work.

            1 vote
  3. Apos
    Link
    I coded my first real Rust application: https://github.com/Apostolique/rust-lilypond-invoke-editor. I don't know if I understood everything with the text manipulation that I'm doing, but it was...

    I coded my first real Rust application: https://github.com/Apostolique/rust-lilypond-invoke-editor.

    I don't know if I understood everything with the text manipulation that I'm doing, but it was pretty cool that I could easily get into the Windows system and grab an environment variable.

    It's a replacement for https://lilypond.org/doc/v2.22/Documentation/usage/configuring-the-system-for-point-and-click. afaik I managed to stay compatible with it.

    7 votes
  4. m15o
    Link
    I just released smol.pub, a tiny service to keep a journal on the small net. You use the web UI or CLI to manage posts and have them available on Web, Gemini and Gopher. It comes with what you...

    I just released smol.pub, a tiny service to keep a journal on the small net. You use the web UI or CLI to manage posts and have them available on Web, Gemini and Gopher. It comes with what you would expect: full support for custom domains (including auto generation of SSL certificate for the web), but also custom CSS themes and ability to export all posts. Not that it's a feature, but it's completely free of JavaScript, ads or tracking technology. I'm hoping it helps less technically-inclined people to give a home to their writings, and to discover that there's more to internet than the web.

    Smol Pub is also a paid service. It's the first time I'm releasing something that has a price, and it feels strange. But it's there to stay for the next 10 years, and that's the most sustainable way I found to guarantee it.

    7 votes
  5. joplin
    Link
    For my birthday, my spouse got me a copy of Designing Software Synthesizer Plug-Ins in C++. While it's just slightly out-of-date when it comes to some of the API-related stuff, it's got a ton of...

    For my birthday, my spouse got me a copy of Designing Software Synthesizer Plug-Ins in C++. While it's just slightly out-of-date when it comes to some of the API-related stuff, it's got a ton of great info in it. I've written software synthesizers in the past, but it's been a while, so I wanted to try it again and see what I could come up with.

    5 votes
  6. [2]
    admicos
    Link
    Making a semi-private Discord bot for a group of friends. I just today made a markov chain text generator that uses the group's message history to generate some text and it went... well? It's...

    Making a semi-private Discord bot for a group of friends. I just today made a markov chain text generator that uses the group's message history to generate some text and it went... well? It's mostly gibberish but there definitely is some gold between the mess.

    Also it's starting to get slow at reading 4-5k messages per call, so maybe i should put a limit to that soon.

    4 votes
    1. admicos
      Link Parent
      on a whim i decided to do this with a "real" ai using https://github.com/minimaxir/gpt-2-simple . it ended up. well, i think it actually "overfitted" a bit (started copying actual content, afaik)...

      on a whim i decided to do this with a "real" ai using https://github.com/minimaxir/gpt-2-simple .

      it ended up. well, i think it actually "overfitted" a bit (started copying actual content, afaik)

      i used google's colab to train it, though i might redo it with my old gpu later on if i care enough. it's just that installing cuda on windows is painful.

      i'd love to give examples but the source data is both "in Turkish" and "private group conversations" so I can't.

      2 votes
  7. thismachine
    Link
    I'm slowly porting changes from Python 3.10's pathlib to aiopath, an async pathlib replacement for Python. pathlib was stable for several Python 3.x releases, but some changes were introduced in...

    I'm slowly porting changes from Python 3.10's pathlib to aiopath, an async pathlib replacement for Python.

    pathlib was stable for several Python 3.x releases, but some changes were introduced in 3.10a7 that affects code aiopath relies on.

    3 votes
  8. moocow1452
    Link
    Being unemployed, I had an opportunity to go back to school for free and decided to get serious about it, and start an associates in cybersecurity. I'm also training for CompTIA A+, maybe doing...

    Being unemployed, I had an opportunity to go back to school for free and decided to get serious about it, and start an associates in cybersecurity. I'm also training for CompTIA A+, maybe doing Net+ and Sec+ if people are still considering them valuable. I would have figured that 4 years of work history would have gotten the point across that I know what I'm talking about, but student pricing is pretty killer and it would probably be nice just to have next to my name.

    3 votes
  9. p2004a
    Link
    After a few months of succesfully using it at my home, open sourced a simple daemon listening for BLE advertisements from Ruuvi sensors and publishing them over MQTT: https://github.com/p2004a/gbcsdpd

    After a few months of succesfully using it at my home, open sourced a simple daemon listening for BLE advertisements from Ruuvi sensors and publishing them over MQTT: https://github.com/p2004a/gbcsdpd

    2 votes