Refreshing a JAX-RS backend with some Node.js and Express?

Over the past few year or so, I’ve been building a web app that visualizes amateur radio spots using a digital mode called JT65. The site is currently up and live here: http://www.spotviz.info/#/home

I started building this as an exercise to learn some AngularJS 1.x (I posted a number of posts along the way too). The backend datastore is MongoDB, and there’s a JAX-RS War deployed to WildFly that provides a REST backend to the AngularJS frontend. The majority of the logic for the webapp is all in the AngularJS app.

Since playing with some Node.JS and Express a couple of weeks ago, I’ve been considering if I should have a go at replacing the JAX-RS code with a Node.js backend too. Since the existing code is mainly building and executing MongoDB queries, this wouldn’t be that hard to do a straight replace. Based on what I’ve seen so far of libraries like Mongoose, the replacement code is likely to be significantly more concise than the existing Java based backend. I’ll queue this up for a project in the coming weeks 🙂

Raspbian USB disconnects and USB keyboards

I was looking for a solution to a USB soundcard that would randomly disconnect from my Raspberry Pi (it’s a Signalink USB soundcard/radio interface for amateur radio). Turns out, the issue I was seeing was caused by RF getting into somewhere when my radio was keying up – when I moved the HT radio further away from the Pi (only as far as the length of the connecting cable, a few feet) then my problems stopped. This could probably be avoided better with some snap-on ferrite beads.

In this post (and others), there is a suggestion about adding dwc_otg.speed=1 to your /boot/cmdline.txt. I tried this for a while and this didn’t seem to make any difference to my USB disconnects for this particular USB soundcard. It did however stop a USB keyboard from being recognized (a Gear Head Mini USB). Remembering I had added this param and then removing it solved my keyboard issue.

Lesson learnt: if trying out solutions to problems by trial and error, if something doesn’t work, remember to remove it afterwards in case it breaks other stuff 🙂

 

Resolving SSH laggy responsiveness over Wifi on Raspberry Pi / Raspbian

It’s interesting to note that turning off the power saving features for the common Wifi dongle chipsets used on Raspbian seems to fix not only the pauses where before it would sleep during inactivity, but also it seems to fix/improve the laggy responsiveness even when typing commands over SSH to a Pi. Links to the settings in my previous post here.

Watch for dependency name typos when creating new Spring Boot projects

If you use the Spring Boot CLI, it’s pretty easy to get a new project created from the templates with all required dependencies in place with something like:

spring init --build=maven --dependencies=web project-name.zip

This generates you a zip that you can unzip and import into your IDE and off you go. The trouble with the CLI currently though is that there’s no validation on the dependency names, so if you call

spring init --build=maven --dependencies=wb project-name.zip

You’ll get the same zip generated, but there will be a subtle typo in your dependencies which unless you’ve seen these messages from maven before, you’ll spend a bunch of time trying to work out what’s wrong.

I created a ticket for this issue here, and hopefully this gets picked up as an enhancement.

The maven error in case you’re interested looks like this:

[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.example:testbaddep:0.0.1-SNAPSHOT (/Users/kev/develop/spring-boot/testbaddep/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-wb:jar is missing. @ line 27, column 15
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException