Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Cuddly Throwable Application Server

The Cuddly Throwable Application Server

Computers are getting small enough and cheap enough that they’re almost disposable. It’s possible to sock computers away almost anywhere, and to connect almost anything to the internet. At the same time, the Java stacks that we know and love are also getting lighter and cheaper. That combination means it’s possible to put a full spec-compliant Java EE server on ridiculously cheap hardware, and then throw it around the room without worrying too much about breaking stuff.
Source code: https://github.com/holly-cummins/throwable-application-server

Holly Cummins

June 05, 2024
Tweet

More Decks by Holly Cummins

Other Decks in Programming

Transcript

  1. @holly_cummins “I think there is a world market for maybe

    five computers.” — Thomas Watson, chairman of IBM 1943
  2. @holly_cummins Why care about the Internet of Things? This could

    really benefit my business This is so FUN and COOL and OOH I made it LIGHT UP!”
  3. @holly_cummins pcDuino £60 Dual-core CPU 4 GB flash storage 1

    GB RAM “Arduino-ish” pins Wi-fi Battery connector
  4. @holly_cummins … and then what happened? Wires snapped. Many times.

    Inside a unit that had to be disassembled before any repair could be done.
  5. @holly_cummins … and then what happened? • Connectors are not

    as easy as one might hope PcDuino battery interface
  6. @holly_cummins … and then what happened? • Connectors are not

    as easy as one might hope Popular embeddable battery PcDuino battery interface
  7. @holly_cummins … and then what happened? • Connectors are not

    as easy as one might hope Popular embeddable battery PcDuino battery interface
  8. @holly_cummins … and then what happened? • Connectors are not

    as easy as one might hope Popular embeddable battery PcDuino battery interface JST-PH
  9. @holly_cummins … and then what happened? • Connectors are not

    as easy as one might hope Popular embeddable battery PcDuino battery interface JST-PH
  10. @holly_cummins … and then what happened? • Connectors are not

    as easy as one might hope Popular embeddable battery PcDuino battery interface JST-PH JST-SH
  11. @holly_cummins “The board features a difficult-to-get JST-SH connector. You won't

    find a battery with a ready-made five-pin JST-SH connector. ” http://wt.tuxomania.net
  12. @holly_cummins “The board features a difficult-to-get JST-SH connector. You won't

    find a battery with a ready-made five-pin JST-SH connector. ” http://wt.tuxomania.net !&!^@*!
  13. @holly_cummins … and then what happened? Battery voltage isn’t enough

    for LEDs. Or sensors. LiPoly battery. Standard 3.3V output.
  14. @holly_cummins … and then what happened? What does that mean

    in practice? Normally, 0 = bounce. With insufficient voltage, pin is always 0.
  15. @holly_cummins –My mother “Holly, I saw a video of your

    sphere talk. I thought you handled the fact that the demo failed really well. Are there any videos where it actually works?”
  16. @holly_cummins … and then what happened? Pin on power board

    snapped. Remnants of pin in PCB hole. Not supposed to look like that.
  17. @holly_cummins It’s ok! I bought a new battery. (and the

    damaged one isn’t in my house anymore)
  18. @holly_cummins It’s ok! I bought a new battery. (and the

    damaged one isn’t in my house anymore) It’s ok! I bought two new batteries.
  19. @holly_cummins - My partner “Holly, I keep telling you you

    should refuse to do this talk anymore.”
  20. @holly_cummins - My partner “Holly, I keep telling you you

    should refuse to do this talk anymore.” (I didn’t even tell him about the exploding batteries.)
  21. @holly_cummins Look before you leap. You will need: • Spare

    money • A lot of time IoT development checklist
  22. @holly_cummins Look before you leap. You will need: • Spare

    money • A lot of time • A high tolerance for stress IoT development checklist
  23. @holly_cummins WebSphere Liberty installs only the Java EE features needed.

    For my application, that’s a lot of features.
  24. @holly_cummins WebSphere Liberty installs only the Java EE features needed.

    For my application, that’s a lot of features.
  25. @holly_cummins WebSphere Liberty installs only the Java EE features needed.

    For my application, that’s a lot of features. (I used a lot of programming models. )
  26. @holly_cummins // parse VCAP_SERVICES String VCAP_SERVICES = System.getenv("VCAP_SERVICES"); JSONObject vcap

    = new JSONObject(VCAP_SERVICES); JSONArray json = vcap.getJSONArray("iotf-service"); JSONObject credentials = json.getJSONObject(0).getJSONObject("credentials"); String host = (String) credentials.get("mqtt_host"); Integer port = (Integer) credentials.get("mqtt_u_port"); … MqttClient client = new MqttClient(uri, id); MqttConnectOptions opts = new MqttConnectOptions(); opts.setUserName(username); opts.setPassword(password.toCharArray()); client.connect(opts); client.setCallback(this); client.subscribe("iot-2/type/+/id/+/evt/+/fmt/+"); Everything is a service (12-factor style)