The Steve, Woz, Sculley dilemma

Hello, lovely people of planet Earth. This is me again, Roy, coming to you direct in a slightly inebriated state. Recently, I have had quite a bit of spare time, and like all human brains, my thoughts too have a tendency to wander around when allowed the luxury of free time. So, I did a bit of that reflection thing and found three characters that kind of sum up my entire dilemma.

It seems like a long time back when we were just a few guys sharing a room, and at times sharing a dream, of putting a dent in this universe. Those were the JEE prep days, and maybe also a bit of Senior Secondary schooling on the side. Walter Isaacson’s biography of Steve had just come out and the four of us had one copy between us (those were the heady days of Flipkart), we couldn’t decide who got to read it first and so each of us got to read one chapter at a time, and thus the book went around. The excitement around that book carried on for weeks, every nuance, every character trait of his was a topic for discussion. We chided him for his estrangement of Lisa, and hailed him for his vegan quirkiness, for his obsession with A-players and his fixation with straight traces on the circuit board, mocked him for his ‘reality distortion field’, but soon enough Apple was the most valuable company in the world.

It was only a few years later that I read Woz’s version of it all. To be honest, it was kind of a letdown, nowhere close to the thriller that Isaacson had produced, of course under the direction of the maestro himself. Woz seemed way more focussed on the personal work that he had produced, rather than the story that Apple had written, his pride in his designs overshadowing the larger impact that they had. His dad being an electronics engineer at Lockheed, Woz got a really early start into the world of electrons and the plumbing that made them flow, his dad was a true Engineer at heart and instilled in him a pride for Engineering. Woz got hooked, and soon, was miles ahead of his fellow students, this feeling of being the best, at what he believed was the most important profession in the world(Engineering) kept him yearning for more, he didn’t wanna lose that lead. From those very early days, his designs were not just about getting something done, they were a source of pride for him, they were about doing things in the cleverest way possible, they were the canvas for his craft. This obsession led to tweaks here and there, that others would/could not care about, all these small innovations added up. This obsession with electronics also meant that he was constantly creating new designs and devices, each project added to his intuitive understanding of electronics and became a stepping stone to bigger, more complicated projects. All of this experience with TVs, computers, and calculators came together in Apple I to create a truly revolutionary design for that time, a computer that had a display and a keyboard in place of indicating lights and punch cards, a computer that stored a boot up program in ROM, so you didn’t need an hour of fiddling just to get it up. The bits and pieces had already been there, but no one had the cumulative knowledge to connect those dots.

Steve too was a quiet child and though he was also interested in electronics from an early age, he did not have the kind of exposure that Woz had. Steve’s dad was a mechanic and could only teach him some basic electronics. His childhood was kind of a story of missed potential, he got good grades but was bullied at school, to the point that his parents decided to shift in order to get him into a better school, where Steve got introduced to computers. He fell in love with the concept, but could never dive in the way Woz could, after all, Woz had his very own personal Aquaman, his dad. Later on, he would get introduced to Woz and the two of them would become good friends, goofing around, and then starting Apple Computers.

Now, while Sculley did write a book about his time at Apple, I never got around to reading it. So, we will make do with the prevalent public opinion and maybe interpolate a few observations of our own.

The starting of Apple was a two step process

  1. Woz invents a revolutionary computer interface
  2. Steves takes that idea, puts on a pair of Nikes and runs like hell

If Woz’s story was about pioneering designs, Steve’s story would be about sheer will. While Woz brought Apple into existence with his pioneering design on the Apple I and then the more mature Apple II, it was Steve who kept the ball rolling and ensured that Apple stayed at the forefront of technology, bringing together Engineers who could do it over and over, scouring the globe for technologies that could open up the next frontier, the GUI from Xerox, Capacitive Touch from FingerWorks, Gorilla Glass from Corning, et. al. The important point being that he knew exactly how much to stretch, which products could be made possible with the technology of the day and which ones would trip the company over. He could judge, how much paranoia added to the appeal and when to open up, say putting a USB on the iPod or bringing the Office suite to mac. Steve could take those decisions because he understood the technology, he himself was in awe of what computers could do and was driven to make an impact in the industry. Scully, when given the same mandate, made poor choices, both with product and strategy, this even though he had been a star at Pepsi. Licensing away Software, he diluted away their value proposition, with Newton he chased a product that was not possible in the day. Scully came from a business where his primary job was managing numbers. A technology business is fundamentally different from a bottling business, in a bottling plant the primary concern is to keep the taste constant, tech on the other hand moves really fast, the primary concern being to clamber on and stay at the top of the pile, especially for newer companies. Bureaucrats might be well suited to running cargo ships, but U-boats demand a Barbarian at the helm. Take the recent rise of AMD under Lisa Su(a Ph.D. in Electrical Engineering), over Intel under Bob Swan(no Engineering Degrees).

Pick and Choose, Mix and Match –

  1. The Bomb Maker – Woz
  2. The Guerilla Leader – Steve
  3. The Police Officer – Scully

A hydroponic garden controller and a beginner’s guide to jump-start development with the ESP32

A couple of weeks back I started a project to develop a controller for my indoor hydroponics garden. This is the first in what will be a series of posts, bringing you assimilated knowledge from multiple sources while also helping me archive the development process.

Around October 2018, me and some of my college friends started an experiment in Hydroponics, we wanted to understand the basics and have a taste of how easy or difficult it was to grow a plant this way. Essentially, we wanted to dip our toes and test the waters with minimum time and effort. We started a single tomato(encrypted word) plant in a bucket using nutrients from Amazon and just left it out in the sun. It grew quite well for sometime but around December as the temperature plummeted, the plant began to wither, for a while we left it on its own but with further signs of impending doom, we decided to take it in and placed it indoors under a 100 Watt Incandescent bulb. The bulb was manually controlled at first but then we regularly failed to flick that switch on time, hence it was moved to an Arduino. In this upgrade, we also installed a Hair-dryer and a DHT11 temperature sensor for better temperature control. The plant flourished for a while but then stopped growing once again. The problem turned out to be in the nutrients, we had neglected checking the pH and salt concentrations. Anyway, we corrected it and had a reasonable harvest, but far from ideal.

The trial taught us a lot, but it also gave us conclusive proof of our laziness(wonder how engineers raise kids). Kids are something for the future but a garden was today’s problem. Hence this quick and simple project with the following requirements-

  • Control following parameters for the grow room-
    • Temperature (DHT11)
    • Humidity (DHT11)
    • Lights (LED tubelights)
    • Nutrient solution concentration(analogue, diy ec probe)
    • Nutrient solution pH(analogue pH sensor off Amazon)
  • Logging of the above parameters for analytics(planned 😉)
  • Allow adjustment of the set-points through a web application or an android application
  • Keep local backup of the last received set-points
  • Issue alerts if control for any of the parameters is failing

An initial search for “IOT development board” yielded two prominent results, NodeMCU and the ESP32 dev board. Not having followed the IOT maker space for the last two years, these two boards were unheard of to me, but on-board WiFi and Bluetooth with a 240 MHz dual core processor for ₹ 500 was quite interesting. A bit more googling on the community, support, development options and examples sorted out the ESP32 as my platform for this project.

The ESP32 is a recent Chinese offering and is the go to board for IOT makers these days for its low price and handsome hardware. The board has developed a sizeable community and you can find support with relative ease, should you stumble.

There are multiple options available for software development, but three of the most popular ones would be ESP-IDF, Arduino and Mongoose OS in no particular order. I decided to take Mongooose OS and code in JavaScript as I will not be running any resource intensive tasks, the control scheme is relatively simple for all of the parameters.Also, I do not have much of a background in Micro-controller programming and this way I could execute the development with relative ease.

MQTT was chosen as the communication protocol for its ease of implementation, popularity(brings along community support) and robustness, in that order. The broker was chosen to be AWS because, first- its AWS, second- it is free for one year and third- didn’t have to buy a pi. Since, I was already using AWS, I also decided to use their Device Shadow implementation which basically creates a virtual device in the cloud that the UI can interact with even when the actual device is offline. The changes are communicated to the physical device when it come online.

Software choices
Data Flow Block Diagram

How to get a Shadow service running with the ESP32 and AWS?

  1. Register on the AWS website
  2. Clone https://github.com/mongoose-os-apps/example-shadow-js and use the sample code for step 3, the code referred to on the below link uses an older AWS library.
  3. Follow the steps on this page https://mongoose-os.com/docs/mongoose-os/cloud/aws.md
  4. Use the files and folder structure from step 2 for further development

Non-Essentials and Quirks-

  • Save device configuration parameters during Flash-
    • run mos conf-get in the mos UI, this prints a list of configuration parameters on the current device
    • add AWS certificate and key files to the fs folder if configuring the AWS MQTT connection in mos.yml
    • find the configurations that you want to be set during flashing and add those to the mos.yml file, the example shown below is for WiFi configuration
config_schema:
- ["wifi.sta.enable", true]
- ["wifi.sta.ssid", "ssid"]
- ["wifi.sta.pass", "password"]
  • To set the time zone-
config_schema:
- ["sys.tz_spec", "s", "IST-5:30", {title: "Time Zone: See formats for the TZ env var: \"man tzset\""}]
  • What happens in case of Run-time errors?
    • The OS supports a very small subset of JavaScript, many regular keywords like switch-case are undefined, it will throw an undefined keyword error in such cases
    • Certain errors like using undefined variables will simply hold the script from executing without any print
    • Errors in function calls also result in a similar looking situation
  • Stack Overflow error-
    • Due to the lack of a switch-case construct, I ended up using around 20 nested if-else statements in one case, and the OS printed a message – Guru Meditation Error-canary watch-point triggered
    • This is a stack-overflow error and can be prevented by increasing the stack allocation, add the following lines to mos.myl, this is double the default stack size
cdefs:
MGOS_TASK_STACK_SIZE_BYTES: 16384

Around 25% of the work has been done, I will be describing the project from a Hydroponics specific perspective when it is more complete, with the transducers, actuators and control strategy employed.

The demons conspiring to chain us down – a look at our mental blocks

Featured

We have come up to the third post on this blog, and given my history of abandonment and procrastination, it already is, something.

The last couple of years have been a bit of a mental muddle for me, especially the last one. Initially, it felt like a passing phase but then it stretched. I felt like a fake, trying to hold a facade, I had become afraid of failure, of trying, my eyes constantly lingered on the destination and not the trail. At times I longed for someone with whom I could lay bare these vulnerabilities of mine, someone who wouldn’t stab me with my armour off. All of this unpleasantness forced me to look at myself and troubleshoot what was going wrong. Yes, there were a couple of external factors playing their part but today, I believe all of it distils down to one single point, I was unable to respect myself, no longer proud of being myself.

The stage for this was set in the first two years of my college. I cannot speak for all institutions but the Indian Institute of Technology BHU has this culture where effort is downplayed and the results glorified. Essentially, the higher your perceived result/effort ratio, the bigger your clout. All of this didn’t matter to me initially, as an underdog, just another random face in the crowd. But then time passed and as everyone does, I too started having an impression in my tiny portion of the universe. I started growing a reputation of someone who knew how to get things done, how to build things that worked, also came the reputation of someone who didn’t study his coursework. All good, even enjoyable for a couple of years, but then things changed.

As a natural part of growing up, I moved on to bigger, more complex projects but I had already set myself up for failure. I had developed a fear of failure and far worse, a fear of lowering my perceived result/effort ratio. A larger project brings with it bigger challenges, which need more effort, ingenious and maybe far fetched solutions, but every time a project floundered, instead of doubling my efforts, taking more creative, more risky approaches, I would instead cut losses(risk/effort ratio) and bail off. A couple of consecutive failures take a big hit on your confidence and you begin anticipating failure, spiralling into a self-sustaining vortex.

I picked up a camera in the third year of my college, quite determined to learn photography, Starting with books and blogs, I got reasonably good with object photography since I could practice that in my room, alone with no one else there to judge the results. The problem was that I could not click people, presented with an opportunity to click people, my brain would suddenly find itself dropping down a well of laziness, it would find something more important, urgent. Once in a while, I would win in this battle against my own insecurities, but often I failed. The point to be noted here is that quite often, the thing we most dearly want is also what we are most afraid to go after since we have attached too much value to it. We become afraid of failure, holding off till a hypothetical day when we will be fully prepared to take on the challenge, a day when we would have eliminated every probability of failure. That day never comes.

There is a misguiding force in our heads. It pulls us away from our strongest calling. I have been a victim of this force, still am, probably a lot of us are. Look out for the things you are most reluctant to pursue, hidden underneath would be your deepest desires, run after them ignoring every misleading story that your brain makes up, you would find happiness.

The writer William Faulkner was once asked ‘Do you write on inspiration or on a schedule?’ Faulkner replied. ‘Well, of course I write on inspiration, fortunately it strikes every morning at a quarter past 9.’

GET UP AND GET CRACKING. EVERY TARGET OUT THERE ASKS FOR A PAYMENT IN THE CURRENCY OF EFFORT AND EFFORT ONLY. PAY THE BILL TAKE YOUR GOODS HOME.