Friday, August 20, 2021

My Flutter development environment

I experimented with Visual Studio Code editor with the Dart and Flutter plugins and it works fine, but I settled on the Android Studio experience because I liked how tightly integrated it is with respect to the editor, emulator, flutter inspector, and flutter performance tabs.  Also I was comfortable with Android Studio from past experience doing native Java development on Android.  I made some notes:


Daily Use (about two minutes from startup to running the demo counter app in the emulator):

"start" "android studio"

"tools" "avd manager" start my preconfigured emu (I used Android 10.0 aka API 29)

"file" "new" "new flutter project" it'll ask where my SDK is located and project name, etc.

"run" "run"


Testing and Notes:

Run "flutter doctor" from command line to verify installation

Managing AVDs  https://developer.android.com/studio/run/managing-avds


Setup:

https://flutter.dev/docs/get-started/install/windows

Note, I installed my flutter SDK in C:\Users\vince\Documents\flutter, your location will vary..

https://developer.android.com/studio

https://flutter.dev/docs/get-started/editor?tab=androidstudio

Thursday, August 19, 2021

LoRaWAN with The Things Indoor SX1308 Gateway

I've been learning about The Things network and LoRaWAN in general and set up my indoor gateway.  

https://www.thethingsnetwork.org/docs/

https://wiki.seeedstudio.com/The-Things-Indoor-Gateway/

https://www.seeedstudio.com/The-Things-Indoor-Gateway-US-p-4710.html

https://www.thethingsindustries.com/docs/gateways/thethingsindoorgateway/

I bought it from Seeedstudio a couple months ago.  Costs about eighty bucks.  Comes in a little green paperback sized box.  Its a bit heavier than I expected; turns out its got a built in wall power supply, so it plugs into the wall like a wall wart.  The pictures online show a vast array of euro power plugs; I bought a device with the USA 915 MHz radio module, and received a US power plug, so not really any point in providing a German power connector with USA radio hardware.  Also comes with a free usb-c cable.

I assigned it a LAN ip address in my router/gw address range on netbox, then set up forward and reverse DNS for the device in my samba domain, then set up the static ip address for the wifi mac address in my redundant DHCP servers.  The MAC address is on the power input side of the device in roughly 2 mm tall text (used a magnifying glass).

https://github.com/netbox-community/netbox

Setup is the usual wifi shuffle where you reboot, enter a setup mode, it creates an access point, you connect to the wifi ap using your phone, login using the wifi password written on the device, set up to connect to the "real" wifi, save and reboot, much flashing lights later the green LED is on and its pingable on my LAN.

Note the Seeedstudio wiki is out of date and the instructions on thethingsindustries should be followed.  For example, the EUI now is two bytes longer, insert hex bytes FF FE after the first 3 octets.  Also you "claim" pre-registered gateways, not register them.  I set my frequency plan up as US_902_928_FSB_2 because it seemed correct.  I set my gateway location on the website and probably correctly enabled auto-firmware-updates on the stable update channel.  Also the instructions fail to note that after claiming the gateway, it will not be in connected status until 24 hours or manual reboot.

I intend to use this with some STM32 LoRaWAN dev boards, write some IoT software using some I2C sensor breakout boards.  I also own a commercial sensecap soil monitor (like what industrial farms use) to verify my gateway is operational.  This will all be the subject of a future post...


Flutter in Action Chapter 2 "Brief Introduction to Dart"

Completed taking notes on "Flutter in Action" chapter 2 "Brief Intro to Dart".

https://www.manning.com/books/flutter-in-action

Given the small number of pages in the book, its very information dense and provides a broad overview of the Dart language for a seasoned programmer; I would not want to walk into that chapter having never done programming before.  If you already know Java, Scala, Clojure, maybe Ruby, it would be easy to transition into Dart using this chapter.  Everything in the chapter made sense and was clearly written.


This seems like a longer format version of chapter 2 from the Dart community:

https://dart.dev/guides/language/language-tour

I intend to go thru this tour and review it at a later date.  Really, I should just read everything on dart.dev


There seem to be a large number of half started Dart koan projects.  Example:

https://github.com/Flutter-Explained/dart_koans

I will try to find a larger collection of Dart koans.


Anyway, onto chapter 3, "Breaking into Flutter".

Wednesday, August 18, 2021

Google's "Build Apps with Flutter" badge

Completed Google's "Build Apps with Flutter" pathway and obtained the badge as can be seen on my google developer profile.  DartPad is quite a bit different than the Visual Studio Code with flutter package that I'm used to, but it does work.  There's a bug in the badge pathway where two out of the three codelabs are 404 errors.  Its Google, so there's no way to provide feedback or file a bug.  I passed the quiz at the end anyway having read the "Flutter In Action" book.

https://developers.google.com/profile/badges/playlists/intro-to-flutter

I've been writing Android Native apps for a couple years, kinda tired of null pointers.  Got very interested in cross platform Flutter and started reading Eric Windmill's book "Flutter in Action".  Made a project outline in Asana to teach myself Flutter.  I'm impressed at how flutter does not need a javascript bridge between the code and platform.  I've played with electron in the past and flutter is smaller and faster.  Also I like Dart a bit more than I like node.js... at least so far...  I like the stack traces from Flutter and I like building my UI in flutter widgets rather than native classes.  Fast recompiles are nice.

https://flutter.dev/docs

Eventually, I would like to convert Supplement Tracker (an app owned by the LLC) to Flutter.  It started out as a Java app, then Kotlin, maybe now flutter. 

As per above continued taking notes on "Flutter in Action" chapter 2 "Brief Intro to Dart".  Which is brief in the sense of being fifty pages instead of an entire five hundred page book.

https://www.manning.com/books/flutter-in-action

Added "full set" of CompTIA certificates I had earned in the past, to linkedin. A+ Net+ Sec+.

I set up this blogger blog.