362: Permutations of Underscores

Transcript from 362: Permutations of Underscores with Elecia White and Christopher White.

EW (00:00:06):

Welcome to Embedded. I am Elecia White. I'm here with Christopher White. It's just us today. So we have lots of little things to chat about.

CW (00:00:16):

Hello, I'm awake from my nap, I believe, unless this is a dream.

EW (00:00:22):

Could be.

CW (00:00:22):

Okay.

EW (00:00:24):

Is there anything you particularly want to talk about this this time?

CW (00:00:28):

I want to talk about Python and how I'm trying to learn it for real, instead of using it as a scripting language I barely know. No, I don't know. Something we could talk about.

EW (00:00:39):

I mean,...I use Python as an amateur.

CW (00:00:47):

Yeah, yeah.

EW (00:00:47):

I know that anytime I have a for loop I'm doing it wrong, but I'll still put in a for loop if I'm lazy, and it's not time-critical.

CW (00:00:54):

I mean, for loops are usually okay. But I tend to find myself feeling like I should be doing "for x in the collection" or "for x in range" instead of "for i equals 0 to 100," and then do stuff with the indexes. But yeah,...I'm writing more Python because, one project that you know about, I'm interfacing with hardware, and I've got to talk over a CAN bus and stuff.

CW (00:01:20):

And the reason I'm using Python for this is because the client, I believe, would not be interested in me throwing a bunch of C or C++ at them and saying, "Here's your software." And then disappearing a year from now. They know Python. They're familiar with it, and comfortable with it. All their other code is in Python...That's a perfectly valid reason to use a particular language, is you're familiar with it.

CW (00:01:45):

And there's no special performance requirements for this. So, yeah, I just found myself, "Okay. I've got to write this script to talk to this device and gather data" and I'm like, " Well, maybe I should actually architect this code," not, okay, architect's a big word. "Maybe I should design this code with a little more thought than I usually do when I'm writing a Python script."

CW (00:02:01):

Which is more like how I wrote code when I was 10 in Applesoft BASIC. Just like, "Okay, we start here, and we finish here, and in-between stuff happens, and it spits stuff out, and we're done. And God help you if you want to maintain this code. So this is a little more complicated, where I have to talk to a network, and then I have to parse packets, and there's various kinds of packets.

CW (00:02:23):

And it's not the sort of thing that really is conducive to choose your own adventure, kind of, just splat-stuff-in-order-and-hope-for-the-best coding. So I've been trying to pick up some more language features and use it in a more object-oriented way than I had been. So it's kind of interesting. I'm learning some things that, I don't know if they bug me exactly, but I'm surprised.

EW (00:02:48):

You mentioned the underscores.

CW (00:02:52):

Yeah, that's the one that surprises me.

EW (00:02:53):

I mean the class part and the object-oriented -

CW (00:02:56):

Sure, yeah.

EW (00:02:56):

- that I'm pretty familiar with. Especially, I use GStreamer. I use Matplotlib -

CW (00:03:01):

Yeah.

EW (00:03:01):

- and NumPy.

CW (00:03:02):

Yeah.

EW (00:03:02):

And those are all very class-oriented. So when I'm looking at their code, I get used to the class parts. But I didn't even realize that "underscore, underscore, something, underscore, underscore," really meant something different. I thought it was just a naming convention.

CW (00:03:19):

Yeah...So the one thing I'm having trouble with coming from Swift and C++ is that Python is a little looser because of the way it handles types and things. So, some of the things I'm familiar with doing in object-oriented programming, it either does in a different way, or it's just kind of like, "Well, you don't really need that. What are you doing?"

CW (00:03:39):

But one of the things is, yeah, this underscore business. I was interested in, you make an object in Python, a class, you have to give it a constructor. And the constructor is always "under, under, init, under, under." And I was like, "Well, that's kind of weird." Because that looks like a C reserved keyword when you're -

EW (00:03:58):

It's kind of ugly.

CW (00:03:58):

- printing out your file and line or something in printf when you're writing debuggers. It's weird. And so I wondered what that was about, and asked people on Twitter, and got a lot of good answers. And it turns out if you search for Dunders, Python Dunders, you get a whole bunch of articles on how the underscores work in Python, but it's not just the surrounding double underscores.

CW (00:04:20):

There's every variation you can imagine of underscores. Before and after a keyword mean different things.

EW (00:04:28):

The keyword?

CW (00:04:28):

Yeah. So "init."

EW (00:04:31):

Okay.

CW (00:04:31):

So "under, under, init, under, under" is a reserved keyword for Python. It's special. You can't have this, you can't write that function in general, and have it mean something else. It's always a constructor. And there's another one called "call." And some other stuff like that. You mentioned "version." That's another reserved one. So if you surround it with double underscores, that's a reserved keyword.

CW (00:04:53):

If you have one underscore in front of a symbol, then that means it's private to whatever scope you're declaring it in. So if you want private member functions or properties in a class, single underscore in the front. So I found that one useful, and I was like, "Oh good. I was looking for how to do that. So that's great."

CW (00:05:12):

And then there's different meanings. If you have one after, or two after, or two in front, anyway, you can look it up. I did not memorize the entire taxonomy of permutations of underscores that exist in the universe of Python. But that was one of the things I've been learning...It's an interesting language...I don't want to go on about Python for hours, but to do the network thing I'm doing, I'm having to do some strange things.

CW (00:05:44):

So in C, when you get a network packet in, typically you have a struct that maps to the exact bits on that network packet. A lot of people sometimes will do a lot of shifting and masking and stuff and shove it into a struct later. But I find in almost all networking code I've written or read professionally, it's better done as a struct with bit fields and byte order gets involved in that.

CW (00:06:16):

But you read from the network device, you splat your buffer into the struct that fits it, and then you can just read out your fields. And you don't have to stand on your head and do a bunch of shifting and masking. I'm trying to figure out how to do that in Python, because I got this thing coming in from CAN, and it's even worse than a normal network packet.

CW (00:06:35):

Don't get me started, but, because they've split fields, where some of the high bits are completely separated from some of the low bits of the same field by other stuff. So that's really fun. You can't even define a struct perfectly, but I wanted that kind of behavior, where I have a struct and I splat stuff into it.

CW (00:06:52):

And before you say struct, which is a module in Python, which is really cool, where you give it a format string, and it knows how to unpack, and pack data in a buffer. That doesn't work for sub-byte-wide things. So if I have two bits of this, and then six bits of this in a byte, it can't do that. Yes, there is another module, but I didn't want to add a dependency. But there's this thing called "ctypes," which it's part of Python. It's not something you have to pip install.

CW (00:07:24):

But it's very disturbing because I feel like it breaks Python, but I ended up using it because it's really nice. You can define a C-style struct and pack and unpack into it. You can also use pointers, but I didn't get into that...So ctypes was kind of cool, because you can create a class that derives from a superclass called "structure," and then you lay out your struct much like you do in C, although it's more like a table in Python.

CW (00:07:57):

And then when you want to stick stuff into there, you just read it out, or you can stick it from a buffer. If you have a memory buffer, you stick into the structure, and then - so what I'm doing is, I have one of those, and then I created an intermediary function that takes that and puts it into a more nice Python class that somebody could use. I'm hoping to isolate that from the client.

CW (00:08:18):

So, "Yes, there's this weird C-type thing in here, but you don't need to worry about that when you use any of this. You'll just see the API, which gives you the fields you want." So I don't know, it's a cool language. I like Python a lot. It's just I have prejudices and biases from other languages that I need to figure out what the similar things are in Python, or why the things don't exist. And what the motivation is.

EW (00:08:46):

This whole Dunders thing is really incomprehensible to me. Python has made it so that you can do dir() on some structure, and it tells you what is in there. And it's got these keywords that help you.

EW (00:09:02):

And then it has these other keywords that are completely hidden, and you can't even search for them? I mean, the word Dunder, I'd never heard it before now. And how was I supposed to ever know about that? Even now searching for it? I don't end up at python.org. I end up at a bunch of other places.

CW (00:09:21):

Yeah. And, that I don't know where you'd find it on python.org. I will link the article somebody sent me in the show notes.

EW (00:09:33):

I mean, I did find it on python.org.

CW (00:09:35):

Oh, you did. How?

EW (00:09:35):

Under data model.

CW (00:09:36):

Data model. Yeah. Well,...some of it's internal stuff, so, it's kind of -

EW (00:09:42):

But it's just the double ones and I don't know how to go about finding the single ones. And they have special other special things about inheritance. Just really weird that you'd have a language that tries to be friendly, and then you'd hide this stuff. Badly.

CW (00:09:57):

Yeah. And some of it's just kind of namespace fixups. Like single underscore in, I don't remember, oh, no, double underscore in the front is tells it to mangle the keyword differently than it normally would at trailing underscores, if you want to. Yeah. So you can read the article. It's interesting. And it is useful to know.

EW (00:10:23):

Yeah. It's just kind of weird...It feels like a inconsistency.

CW (00:10:29):

Now I feel like a power user. Oh, yeah.

EW (00:10:29):

Yeah. Wow. Yeah. When I start actually using lambdas properly, I may become a power user. Okay. So I do have a list of things people have asked us about. Shall we start on that? Or do you have any other, do you want to talk about CAN, because I know you have some strong opinions.

CW (00:10:50):

No, I don't have much to say about CAN. I've never used it before. So this is my first experience with it. It's -

EW (00:10:57):

The Linux tools are much better than I expected

CW (00:11:00):

Oh yeah, the Linux tools are great. So there's a lot of stuff that just seems to be a part of Linux now, where there's utilities, candump, and cansend, and...it's like a tcpdump in a lot of ways. It'll just dump everything that's coming out, and you can filter stuff. Or you can construct a byte string right on the command line, and spit it out CAN.

CW (00:11:23):

And then the drivers seem pretty good too. I'm using SocketCAN, which turns it into a basic socket interface. And once you get that set up, "receive from" works fine, "send" works fine. And you can set up filters that are pretty sophisticated for which CAN message IDs you care about and don't care about. And you spit those into the kernel and the socket options. And so that part's been pretty easy.

CW (00:11:50):

It's the way that CAN stuff tends to be documented that drives me nuts so far. I come from a long networking background, so I'm used to RFCs and things where everything's, a message structure is extremely well-defined. You can almost take it straight from the document and splat it into a C structure. And it all makes sense.

CW (00:12:10):

With this,...so I have one document from the device manufacturer, and it's got all of the messages laid out...It's got them all described in a very big table that's undifferentiated. It's hundreds of pages long, and only has a table header at the start of the table. So once you're 30 pages into the table, you don't know what the columns mean anymore, but it's not in order.

CW (00:12:34):

So if you have a particular message you want, all of its fields are there in contiguous, but they're not in any particular order. It doesn't tell you what order the bits are. So for example, I'm using a radar, and for the radar track message, it has a bunch of stuff. It has the range of the target, the acceleration of the target, the azimuth of the target.

CW (00:12:58):

The usual stuff you'd expect from something..."Where is it coming from?" And "How fast is it going?" That kind of thing. And those, some of those are eight bits. Some of those are three bits. Some of those are fifteen bits. And on the wire, they're all kind of squooshed together in a particular order.

CW (00:13:14):

But in the document, it's like, "Eh, here's the stuff. These are in the packet. These are how wide they are." But this is not the order, necessarily, that they come in. If you'd like to see the order, there's a database file included with the documentation called, I think it's a DBC file? Something like that.

CW (00:13:36):

And I've never heard of that format before, but you can open it with a special free utility from some random company on Windows only. And then...you open that database file, and then you can mouse around and convince it to give you a graphical representation of the bits in each of the messages.

CW (00:13:55):

And so I have this collection of JPEGs that I've been creating in a Windows VM, then copying them over to my Mac,yeah. So that's one thing I haven't really enjoyed. But other than that, it seems like a networking protocol, and it's fairly friendly to work with. Yeah. I assume that the documentation foul-ups are due to it being developed by some industry consortiums or something.

EW (00:14:25):

Seems likely.

CW (00:14:25):

But you've used it, right?

EW (00:14:27):

Yes. But I've used it to put messages over and not looked at the actual messages. And then I've used it for the radar you've used, but all I had to do is make sure it turned on.

CW (00:14:41):

Oh.

EW (00:14:41):

So I didn't end up parsing much on that.

CW (00:14:45):

Yeah. And yeah. And they do some weird stuff. The radar has multiple tracks -

EW (00:14:51):

[Affirmative].

CW (00:14:51):

- instead of having a track ID in the track message, they just made 64, or whatever it is, different track messages. So they have the same contents. They just have a different message ID.

CW (00:15:03):

So if you want a filter on track messages, you have to add 64 filters to the kernel to see them all.

EW (00:15:10):

Oh, that's so sad.

CW (00:15:11):

And because they're not network addresses, you can't mask them. So, it's just, computers are dumb. And I don't like them, but I have to work with them. At least for now.

EW (00:15:28):

I've been using Robot Operating System a lot, which, I mean, it's okay. I'm stuck on Kinetic, which is a particular version that's a little old. And it only runs on Ubuntu 16, which is a little old. And it's just, I'm shaking my head because, I mean the client needs Kinetic, because that's what everything else they do. And I'm just looking at ROS 2 and going "Someday, someday, I'll get to play with that."

EW (00:16:03):

But...I mean, the thing I'm using it for right now, or that I've been working on this week, has been a visualization tool, which is the thing that ROS does well. All the message passing, and the subscribe, and published sorts of models, means that I can put another widget on the network, and have it just be my display for what's going on with everybody.

CW (00:16:27):

Yeah.

EW (00:16:28):

So that's been really cool. The other project I'm working on is Bluetooth, and Zigbee, and a TI chip. And it's a lot.

CW (00:16:42):

You get to do real embedded and the weird embedded that I've been doing.

EW (00:16:46):

Yeah. I mean, with the rviz, and most of that project is in Python, and there's a lot of machine learning that goes with it. And I really do have a good time with all that. Especially as we're entering the last phase of the project, and we've completed most of our milestones, I have a freer range for just trying random stuff. And let's just say, my brain gives me lots of random stuff to try. Okay. Questions?

CW (00:17:19):

No, go ahead. Go ahead.

EW (00:17:20):

I mean -

CW (00:17:21):

Oh yeah, yeah. I have no further questions.

EW (00:17:25):

Okay. So this one came kind of weirdly. We were talking to a friend who said that before, and maybe after meetings, they have these questions that appear on their chat system. So that people have this feeling of going in and out of meetings like we used to, the chat part.

EW (00:17:52):

Which is a good part of meetings that isn't always apparent that it's a good part, because it helps you to know other people as people and not just as engineers. And so one of the questions that was proposed, or written, was what kinds of self-care are you practicing? I thought that was just such a strange question.

CW (00:18:21):

Why?

EW (00:18:21):

I guess, what is self-care?

CW (00:18:24):

Self-care is things that you do that aren't work to try to make sure that you're not burning out, or otherwise turning into a psychological problem, or physical problem.

EW (00:18:43):

There's self-care, and there's self-soothing.

CW (00:18:45):

Yeah.

EW (00:18:45):

And you think about it like a kid.

CW (00:18:47):

Yeah.

EW (00:18:49):

As a parent, you would care for the kid, you'd make sure they were fed.

CW (00:18:53):

Yeah.

EW (00:18:53):

You'd make sure they went to bed on time. They were healthy. They brushed their teeth. All these things that just make sure that for the long-term, they're going to be healthy and happy.

CW (00:19:01):

Right.

EW (00:19:02):

And then you have the things you do when you just want them to go to sleep, or stop screaming, or stop crying. And those are soothing activities. Those are just whatever works.

CW (00:19:13):

Yeah. I don't think that's what this meant by self-care.

EW (00:19:17):

But -

CW (00:19:18):

I mean, there's some overlap, but I think it's more making sure that, I mean, taking the current circumstances aside, it's still something that's important. So exercise is good self-care. Making sure you're exercising. Making sure you're not sitting at your desk for 10 hours a day and not doing anything else.

CW (00:19:36):

Not being too hard on yourself, if you can't work for, can't find yourself working on, various aspects of it. I think most of it comes down to doing things that keep your mental health and physical health up when you're enduring stressful circumstances.

EW (00:19:58):

But it isn't always fun stuff.

CW (00:20:00):

Not necessarily. Yeah.

EW (00:20:01):

Because it often has this aspect of long-termness to it. I don't necessarily want to go exercise, but I know I should, because I will feel better tomorrow if I do exercise. If I don't exercise, tomorrow I'll be probably sad and whatever my brain does when it's unhappy,

CW (00:20:22):

But I think...I mean, true. Yes. Then flossing. Lots of things that aren't great. But taking a nap if you need to, I think that's self-care, as long as you're not deciding that you're going to nap for a week.

CW (00:20:36):

Now if your body's telling you, "I need to nap" and you're fighting it and trying to work through it, sometimes it's better to take a 15 minute nap, or a 30 minute nap, or whatever, than to continue to try to push through and then be unhappy. Same thing with, I blanked out. Because I haven't been practicing self-care.

EW (00:20:57):

Well, that's okay. Because I actually I want to talk more about the nap, and you said if you do it too much.

CW (00:21:02):

Yeah. Yeah.

EW (00:21:03):

So one thing that might be self-care for some people is to take some quiet time and read a novel.

CW (00:21:08):

Yeah. Yeah.

EW (00:21:09):

But the way I do it, it's more like an addiction, and I probably need an intervention.

CW (00:21:14):

Sometimes, but I mean, I think it's fine most of the time. I think...one aspect of self-care is having...that perspective to know when what you're doing is interfering with the rest of what you want to accomplish. If something's interfering, I mean, this is always the thing in mental health, right? And it's a question that gets asked a lot if you're in therapy or something.

CW (00:21:42):

Like, "Oh, this bothers me." Or "I feel like I'm doing this behavior too much" or "Is this right?" And sometimes the response will be "Well, is that interfering with your life? Is that keeping you from doing the things you want to do? And if it isn't, then ask yourself, if you really need to change it, or need to feel bad about it.

EW (00:22:06):

That's a good perspective.

CW (00:22:08):

So, I mean, I would say for you, it's like, "Yeah, okay." You do tend to read a lot, but you don't do other things that other people do. You don't sit and play video games a lot, or whatever different activities that people fill in for leisure time, and you're getting your work done. So, if you weren't getting your work done, that would be a different thing, right?

EW (00:22:34):

Today, I didn't get my work done because my book was very good.

CW (00:22:37):

Yeah. But you should take an aver -

EW (00:22:39):

[Laughter]. But yes, yes.

CW (00:22:39):

Take an average longer than a day, right?

EW (00:22:41):

Yes.

CW (00:22:41):

Because there's plenty of days where people, many, many days when I used to work in an office where I got nothing done, and I was there sitting at my computer, right? And we all know that. And it wasn't because I was reading a novel. It would've been better had I been able to read a novel, because I might've taken two hours to take a break from work, and then been more productive. But I couldn't because I was at a sit-down job.

EW (00:23:06):

So another thing about self-care, is that it's often easier to think about it as things you would do for someone else. I mean, there's the parent model, but also the friend. Would a good friend tell you it is better for you to go take a shower, or to do that last chore that probably doesn't actually need to be done for three days and is totally stressing you out.

CW (00:23:31):

Yeah.

EW (00:23:31):

A good friend would probably say, "Look, you don't have to do it all right now." And so that's part of the care for me. And I have to be careful with the self-soothing because I'm -

CW (00:23:43):

But we all do. I mean, we all have behaviors that -

EW (00:23:46):

It's easy to go from care to soothing pretty rapidly.

CW (00:23:51):

But there are things, too, that are neither, right? They're kind of, Twitter. Spending the day reading Twitter. That is probably neither self-care nor soothing. It might feel like it.

EW (00:24:04):

It's kind of soothing.

CW (00:24:04):

It's kind of soothing, but it's soothing in a -

EW (00:24:06):

It's just dopamine hits.

CW (00:24:08):

Yeah. It's probably not soothing long-term.

EW (00:24:12):

It doesn't make you feel better. Well, I mean, even with crying kids, your goal is not long-term, it's just -

CW (00:24:19):

Yeah, but that's why I think that's not a great analogy because -

EW (00:24:22):

Well, the other analogy I had was programs. Self-care is where you design, where you think about the API, and how the program is supposed to work, and make some unit tests. And soothing is typing at it, praying that this time the bug will go away.

CW (00:24:40):

Okay. Yeah, yeah.

EW (00:24:43):

Or monkey typing where you're just, "Okay, I'll just try this. I'll just try this. I'll just try this" and you know deep down that even if it works, you didn't get there a good way.

CW (00:24:53):

Yeah. Yeah. I just I don't want to tar things that are generally helpful as just soothing when -

EW (00:25:03):

Well, I mean, soothing's not bad.

CW (00:25:05):

Sometimes you just need to turn off the sympathetic nervous system.

EW (00:25:11):

Sometimes you just need the kid to go to sleep, and that's okay.

CW (00:25:15):

Okay. If...your sympathetic nervous system is your kid, then yes. Sometimes you just need it to go to sleep, whether that's meditation, or a nap, or something where you're not constantly activating your stress response. Anyway, I'm not a psychologist, psychiatrist.

EW (00:25:33):

Well, and weirdly, before the pandemic started, we started a book club, which was supposed to be -

CW (00:25:43):

About books?

EW (00:25:44):

About books. And it has turned into a weekly Zoom call with friends. And I think it's more important to all of us than we had ever imagined. And the book we're reading now is ridiculous.

CW (00:26:03):

Is it even really a book?

EW (00:26:05):

It's isn't.

CW (00:26:05):

It's more of a -

EW (00:26:06):

But I mean, we finished the poetry.

CW (00:26:08):

Yeah.

EW (00:26:08):

So, it's not technical management book, which was, I thought, what we were starting. And that counts as self-care. And it's something that I don't always want to do, but I almost always feel better having done it.

CW (00:26:21):

Yeah. Yeah.

EW (00:26:24):

Okay. So the next question, and this is another one of those, chat at the beginning of a meeting questions, is what are you hopeful in the next few years? I'm sorry, what are you hopeful for in the next few years?

CW (00:26:39):

I'd like to get through the next few months. I don't know. Yeah, I'm probably a little too damaged to answer that question right now in a meaningful way. I could come up with something probably, but there's nothing off the top of my head.

EW (00:26:56):

That's kind of sad, although, same.

CW (00:26:59):

I mean, there's things I would like to accomplish in the abstract. There's always music to do, but...a lot of things I'm hopeful for, are more near-term than the next few years. And thinking past, like I said, the next few months, is hard.

EW (00:27:17):

Yeah.

CW (00:27:17):

So I mean, there's some obvious things that I'm hopeful for in the next few months, but beyond that, in the next few years? I mean, I'd like a few years of kind of normal quiet. If that's in the cards, that's what I'd be hopeful for.

EW (00:27:33):

There's a decent chance we'll get a roaring twenties out of this as people get so excited to see each other again.

CW (00:27:39):

Well, I don't really like the flapper dresses that much. I don't think I would look good in them.

EW (00:27:44):

Okay. So moving on, this one's a listener email, and it says, "My name is Yashesvi, and I'm from India, I listen to embedded.fm podcast, and it's entertaining as well as informative!" That's awesome. We like to hear that. Yashesvi wonders if we can suggest solid certifications that would be nice to have in the embedded/firmware field. Do you have any certifications?

CW (00:28:15):

No.

EW (00:28:15):

Yeah, me neither.

CW (00:28:16):

The hilarious thing is Cisco had certifications.

EW (00:28:21):

Yeah, they were really big on certifications.

CW (00:28:21):

And nobody, I don't think anybody in the engineering team had any from Cisco. So...all of the software running the routers is designed, all the routing protocols are designed and implemented by people who, as far as I knew, did not have certifications from Cisco. A lot of certifications tend to be, as far as I know, maybe I'm wrong, tend to be operator certifications.

CW (00:28:45):

So Microsoft-certified engineer, and the CCIE, was the Cisco one. Cisco Certified Engineer, Internet Engineer. They were all about people who use the products to implement stuff. So this is a certification that says you know how to use a Cisco router and put it into a network.

CW (00:29:07):

And you know how routing protocols work, but it's not about being an implementer. Same thing with, I think, Microsoft, it was about how to set up IT stuff. I could be totally wrong, but that was my impression.

EW (00:29:22):

I think the certifications have grown since then.

CW (00:29:24):

Have they?

EW (00:29:24):

Yes. I mean, I know you can get Coursera certifications.

CW (00:29:28):

Okay.

EW (00:29:28):

And that sort of thing. And developer certificates, TensorFlow has one. I think AWS has several, Azure.

CW (00:29:40):

Alright, well, then I don't know what I'm talking about.

EW (00:29:40):

And it's learning to use the tools and making sure that you pass the exam that says you know how to do that.

CW (00:29:51):

At the same time, I've not seen a lot, not worked with a lot of people, who either put certifications on their resumes or said anything about them. So I don't know. It's probably not a bad thing.

EW (00:30:05):

Yeah.

CW (00:30:05):

Is it a good way to learn versus taking courses?

EW (00:30:11):

Well, there was an ML in embedded Coursera course, and I can take it for free -

CW (00:30:18):

What do they give you?

EW (00:30:18):

- or I can pay $50 or $80 and get a certificate if I finish.

CW (00:30:25):

What does the certificate say?

EW (00:30:27):

That I took this class.

CW (00:30:28):

Oh, that's different from a certification. So I'm not sure what we're talking about.

EW (00:30:32):

Well, I mean, either one really. Certification, the TensorFlow is a certification, you have to pass an exam.

CW (00:30:37):

Okay. Yeah. That's what I think of as a certification.

EW (00:30:40):

Okay.

CW (00:30:40):

There's a standard exam that they give and everybody takes it. That makes sense. Yeah. I don't know.

EW (00:30:48):

So, I'm sorry. We are the wrong people to ask, and if anybody else out there has an answer, we will -

CW (00:30:54):

Yeah. And if you have ones that you have, or you like, or you thought were worthwhile getting, or that you've seen people getting positive benefit from.

EW (00:31:05):

Yeah. Yeah, I would be interested in knowing. Okay. So let's see. Oh, this is important. Our media empire is expanding. We have some help, and we are on LinkedIn as Embeddedfm. We're on Facebook, we're on Instagram, we're on Twitter, we're on YouTube. We have a Mailchimp newsletter. Anything you want. I think, I hope, maybe we will end up on Medium too. And we're trying -

CW (00:31:40):

Myspace?

EW (00:31:40):

No, we're not on Myspace, and we're not on Google+, even though it tried to make me add a little icon to our website that said we were on Google+, which -

CW (00:31:54):

It still had that?

EW (00:31:54):

I know.

CW (00:31:55):

That's pretty funny.

EW (00:31:55):

We're trying to play in these areas in the ways that they are supposed to be played in. For example, I was yelled at for putting links in our Instagram. So no more of that. And,...LinkedIn we'll try to be a little bit more professional, Instagram, maybe silly, Twitter will be random...YouTube will still just be the audio. I don't expect we'll have videos.

CW (00:32:25):

And the goal's just to -

EW (00:32:25):

Oh, right. She did ask us for a video, didn't she?

CW (00:32:29):

Yeah, well.

EW (00:32:29):

Oops.

CW (00:32:29):

We'll do something there. Yeah. We're just trying to reach people differently. See how it goes.

EW (00:32:35):

We appreciate it if you follow us. We appreciate it if you retweet, make your story, like our Facebook, I don't know.

CW (00:32:45):

I won't be going on Facebook. So that's going to be its own little thing.

EW (00:32:48):

Yeah. I fear Facebook will be the lonely one.

CW (00:32:54):

Yeah. And I've been thinking about other ideas for other things to do.

EW (00:32:59):

Yeah.

CW (00:32:59):

Should I mention my other dumb idea? See people like it? Go ahead. So, and this is not a guarantee that we're going to do this.

EW (00:33:08):

Really not a guarantee we're going to do this.

CW (00:33:10):

And if you like this idea, let us know. If we get a lot of people saying, "Yeah," I was thinking of having a companion podcast.

EW (00:33:20):

Because our podcast might get lonely?

CW (00:33:22):

Yeah.

EW (00:33:23):

Maybe a pet podcast.

CW (00:33:24):

It would be short form. So 15, no more than 30 minutes definitely. 15, 30 minutes, where people would come on and talk about their projects. And that would be it. It wouldn't be a long form thing where we have a long interview with career and stuff. It would just be project-focused.

CW (00:33:43):

And instead of us going out to find people, we would have people come to us, and find us on one of those 50,000 different social medias that there exist for some reason and say, "Hey, I have this project," and we'd look at it and maybe invite you on to talk. And, it would be low prep for us. Probably lower production value real quick. Maybe weekly on a different day, maybe not. I don't know, I haven't worked out the details.

CW (00:34:13):

But sometimes, you know, it's nice to give people another platform to show off what they've done. We have some listenership so we could bring people to a different audience and sometimes -

EW (00:34:28):

And I like hearing about projects.

CW (00:34:28):

Yeah. And sometimes it's hard to schedule people for the big podcast, when all we want to do is say, "Hey, so tell me about this." And, it wouldn't be video, it would be audio, so that will be a bit of a challenge for some stuff, but probably fine. Anyway, if that seems like a good idea, or something you'd listen to, or something you'd want to be on, let me know.

EW (00:34:51):

Cool. I'm hesitant about this, but -

CW (00:34:54):

Yeah, me too.

EW (00:34:55):

We'll see.

CW (00:34:57):

Yeah.

EW (00:34:57):

Let's see. Oh, back to the media empire. Sorry. I should have brought this up. One of the reasons we trying to kick this off in February is so that we can make sure to tell all of the outlets that we have the t-shirt.

CW (00:35:15):

So we don't get the dozen people afterwards saying, "Hey, your t-shirts aren't available anymore. I missed it."

EW (00:35:19):

Yeah.

CW (00:35:20):

After we thought we shouted from the hills.

EW (00:35:23):

Well, it's hard to shout from the hills when you're just starting out on some of these social media platforms. But -

CW (00:35:28):

Yeah.

EW (00:35:28):

If you want a t-shirt, you only have until the end of February. After that, they may never come back, or maybe we'll do another one when I finally spill coffee on all of mine.

CW (00:35:40):

T-shirts. Get them.

EW (00:35:42):

Yes. I really like the design. It's a Rube Goldberg machine, with many of our past show titles as part of it. There's chickens in helmets. There's a self-driving arm. There's a monkey head in a heart for I love my monkey head, and there's a unicorn sticking it's horn in a light socket for Sunshine Jones's "What the Hell is Wrong with Unicorns?"

EW (00:36:16):

And just a lot of things that made me giggle. Including the Tamagotchi on a potty, which was in honor of the "Potty Train Your Tamagotchi" episode. So I hope you like that. We do have a big list of titles, which I will include in the show notes, if you want to go try to figure out what's what.

CW (00:36:39):

You have nine days if you want a shirt.

EW (00:36:41):

But you have forever to figure out the puzzle.

CW (00:36:43):

Yes, but you have nine days to buy a shirt.

EW (00:36:44):

Yes. Nine days buy a shirt. From today, or when this drops.

CW (00:36:50):

Today is when this drops. No, I've adjusted for time.

EW (00:36:54):

Cool.

CW (00:36:55):

Because it is Thursday right now.

EW (00:36:58):

Yes, it is Thursday.

CW (00:37:01):

Thursday. Okay. Next.

EW (00:37:04):

I think that's true. There is an Embedded conference that's coming up.

CW (00:37:09):

The ESC basically?

EW (00:37:11):

It's a lot of the same people.

CW (00:37:14):

Okay.

EW (00:37:14):

James Grenning, Jacob Beningo, Jack Ganssle, all those people. So, it's May 18th, 19th, and 20th of 2021. It's online, of course -

CW (00:37:32):

That's my birthday. I can't go.

EW (00:37:32):

- and it looks pretty good. I think maybe we'll have Jacob on to talk about it some more, but I wanted to give people a heads-up.

CW (00:37:41):

Alright. I'll go to some of it, but not on the 20th.

EW (00:37:45):

I can't believe you tell people when your birthday is.

CW (00:37:47):

Everyone knows my birthday. You know you can find birthdays online. You just type somebody's name and birthday. That's how I know Bear's birthday.

EW (00:37:56):

And Bear's our dog. Who is sleeping. Very cutely. Okay. You got a Raspberry Pi Pico.

CW (00:38:07):

Four. I have several Raspberry Pis. Raspberries Pi Pico.

EW (00:38:13):

Picos.

CW (00:38:13):

Picos. I've done nothing with them. I did read the SDK manual at one point. But I have not yet plugged them in, sadly. I wish I had before this, but, I have a project in mind, which I haven't gotten started on.

EW (00:38:26):

What's your project?

CW (00:38:27):

So when I'm recording drums, I have my computer usually to the left of me. The drum set being what it is, I can't really integrate my computer into it in a way that it's in front of me at any time. So it's usually to the left of me. And that means when I'm doing a bunch of takes, or retakes, or overdubs, or something, I have to turn to my left and stop and start.

CW (00:38:51):

And it sounds like a first-world problem, but it's kind of annoying to twist a bunch of times and then twist back. So...I went to some of the online NAMM stuff, and there's a bunch of products there, that are basically -

EW (00:39:02):

Wait, wait. NAMM is the?

CW (00:39:02):

Oh, sorry, the National Association of Music Manufacturers? Something like that.

EW (00:39:11):

Big conference dealing with music equipment.

CW (00:39:14):

Gear, yeah. It's a huge conference. Usually a lot of musicians go to that too. So if you get to go to it in-person, it's kind of fun, because you can walk around and trip over Chad Smith and -

EW (00:39:24):

Sit behind the Oingo Boingo drummer, as you listen to a different band?

CW (00:39:28):

Yeah, it's very strange.

EW (00:39:29):

It's very strange.

CW (00:39:29):

It's very strange to have a booth conference, where most of the people walking around are rockstars. Very strange. But anyway, there was a product on the one this year, which was online obviously, which is like a foot switch, a MIDI foot switch. And so it had a bunch of buttons you could stomp on and they would send a particular MIDI command to whatever device you want.

CW (00:39:52):

So, I was thinking, "Hey, that'd be great." I'd just get one of those, and then plug it into my computer. And then I can hit stop, and start, and rewind, without turning around. And just blast through different takes. But I decided that would be really easy to make. So, and then the Pico came out around the same time.

CW (00:40:13):

I was like, "Ah, that's a good project for that." It's not perfect for it. Other micros would work fine too, but there's nothing wrong with it. So it seemed like a good project. So I think I'm going to do that, and I'll probably do it in CircuitPython, because it's super easy.

EW (00:40:31):

I feel like we didn't really introduce the Pico very well.

CW (00:40:34):

No, of course it's been on every other podcast in the universe, so hopefully everybody knows what it is, but go ahead.

EW (00:40:39):

But if you don't, it's not a Linux computer, like most of the Raspberry Pis. It is a microcontroller, with two Cortex M0 processors, and a bunch of IOs, and peripherals, and all that. It is a microcontroller chip designed by Raspberry Pi. So you're not getting an STM32 out of this. You're getting an RP2040. And it's really a cute dev board because it's $4, and you can make it low power, and you can make it do a lot of things.

CW (00:41:23):

...And you can develop with C. You can use MicroPython, CircuitPython, and it has at least one hardware feature that's really cool, that I was reading about in the SDK, that allows you to do some pretty crazy stuff that would be very difficult on other micros. It's called, ah shoot. I'm not sure what it's called now.

EW (00:41:45):

Oh, the GPIO thing?

CW (00:41:48):

Yeah.

EW (00:41:50):

You can also program this with Arduino interface.

CW (00:41:53):

Right.

EW (00:41:53):

So you don't necessarily have to be super comfortable with everything, but you can also get into the big, deep, HAL and sorts of things, including the programmable IO -

CW (00:42:08):

Programmable IO, yeah.

EW (00:42:08):

- the state machines for custom peripherals.

CW (00:42:11):

So basically what they give you after reading the SDK is, there's these eight little state machines that you program in assembly. And I don't know, I think it's not ARM assembly, it's something else. And with that, you can do a lot of the high-speed difficult work of an IO, in that...short section of assembly. So if you wanted to implement a SPI master for example, or -

EW (00:42:42):

If 16 controllable PWMS wasn't enough.

CW (00:42:45):

Right. You can put one there. So any sort of,...UART, they had a UART example. So you can turn the GPIOs into a bunch of things, whatever you like, assuming you can write this assembly. I've seen an example, I think somebody implemented DVI.

CW (00:43:02):

So they plugged into a monitor and had a whole retrogaming setup working, because they were able to basically turn these into high-speed bit banging things. Because you've got the assembly there that's running in hardware specifically designed for these IOs. So I don't think I'll end up using that for my project, but I've got some other things I might play around with. Oh, they had the NeoPixel example too, the WS2812, which is traditionally difficult to do, I think.

EW (00:43:31):

Just put it on the SPI bus. I'm sure that'll work.

CW (00:43:35):

Right. So it's pretty neat, and it's got a good amount of RAM too, for an M0. So, it's a cool little device.

EW (00:43:44):

I saw somebody put a machine learning person detector system on it. There's been a lot of pretty neat projects that have come out of that. Although they're hard to search, because you get Raspberry Pi Pico, and then a project name, and you just end up with all the Raspberry Pi projects.

CW (00:44:04):

What is accelerated floating-point libraries on chip mean? Because I don't think the M0 -

EW (00:44:09):

It doesn't have a floating-point library.

CW (00:44:11):

- has a floating-point unit. So I'm not sure what they mean by that. Maybe they just have floating-point implemented in software, and they're calling it out for some reason? I don't know. But yeah.

EW (00:44:27):

It's cute.

CW (00:44:28):

And there's some other variants coming out too, which is kind of nice. There was, I think Adafruit has one coming, or Adafruit? Arduino I think has one coming that's got Wi-Fi and Bluetooth. As it stands, it's just got USB.

EW (00:44:42):

Yeah. With more IoT connectivity, if it stays in this general price range, it's pretty cool. I mean, I definitely suggested it to someone I was talking to. In fact, I want to get to that question. I've been talking to Peter about a project and he's working on something that's sort of lab-based. So he's not going to make a billion of these. They're not consumer products.

EW (00:45:16):

And he wants it to be customizable for the user, because most labs need whatever they need instead of everything. But he's a software engineer. He's actually the one who talked to me about certifications. And I swear every week he's taking a different certification exam, even though his primary job is software development. I think. I hope.

EW (00:45:43):

But he talks to me about embedded stuff, and he's gotten into Arduino, and it's been interesting to watch him get into the hardware. I always like that stage. So he sent me email.

EW (00:45:59):

"This may sound a little dumb, but I just learned that the ATmega328p chip on the Arduino is removable. It can run all by itself or with very minimal hardware. For some reason, I always imagine it would be complicated to run a microcontroller outside of a dev board. There has to be a reason for all that stuff on the dev board." Okay.

CW (00:46:19):

Some micros.

EW (00:46:20):

Some micros. Some micros are harder than others. And when you think about what's on the Arduino, you have some power control, and you have some ability to plug into USB and reprogram your unit. So you have a programmer there. Those are the two big things that when you go to your own board, you still have to think about. Your programmer, you may move off board.

CW (00:46:50):

Clocks, sometimes you need clocks.

EW (00:46:51):

Sometimes you need clocks.

CW (00:46:54):

Yeah. And with some of the chips you don't.

EW (00:46:56):

And with power, it's not just, "Am I providing power?" But "Am I providing power in the right order as the board comes up?"

CW (00:47:04):

Yes.

EW (00:47:04):

Always super exciting. So I had suggested to Peter that he read the $1 microcontrollers from Jay Carlson.

CW (00:47:14):

Yes.

EW (00:47:14):

Even though that's getting a little older, it's still super useful. And at the time...I don't think Peter got what it was, but now he's getting more into hardware, and he's understanding what's going on. And came and asked the question of,...well, he said, "I keep going in circles because I don't have a specific project in mind, and I'm just trying to avoid ecosystem lock-in or suffering huge switching costs. If I discover a particular feature isn't supported in the ecosystem."

EW (00:47:48):

"I recall you mentioning Mbed boards are a good place to start, because they have a decent set of libraries, but I was wondering what ecosystems you would advise investing time learning and why." And that was the question I really wanted to talk about today is, what dev boards should people look at? And how important are the ecosystems that go with them?

CW (00:48:09):

It depends.

EW (00:48:11):

Of course.

CW (00:48:11):

Right? I mean, it depends on your goal. And I think this comes down to the Arduino question. It depends on your goal. If you're making five of something that only have to operate a relay or do something on a time basis, and your job is to do the other thing, I don't know what this person is doing, but let's say they're making a bird feeder.

CW (00:48:34):

They need to feed birds every five minutes, then use an Arduino. And don't worry about it. If you need to make a thousand of them, then that changes the equation. If you need more power, you need it to do something else, you need it to have Wi-Fi or Bluetooth, then that changes the equation too. And you have to look at a different ecosystem, and that narrows it down. But if he doesn't have a project in mind, then the answer is, "muh."

EW (00:48:59):

Well, he does have a project in mind. But I think the project is so broad -

CW (00:49:05):

Yeah.

EW (00:49:05):

- that he can choose too many things.

CW (00:49:08):

And...I'm kind of flip with these answers a lot of time in saying, "Well, it depends on your project," but it also depends on what you want to learn.

EW (00:49:17):

I actually, I'm taking this from a different perspective. The confusion -

CW (00:49:22):

Sure, sure.

EW (00:49:22):

- that comes from Arduino and Mbed. And what do these things mean? Because both are a type of board, a type of development system, and an IDE.

CW (00:49:35):

[Affirmative]. Yeah.

EW (00:49:35):

And I just think it's really confusing.

CW (00:49:37):

I agree.

EW (00:49:38):

If you look at Mbed, it is a free online compiler from ARM, who makes the Cortex M series processors. And there are dev boards that conform to the Mbed standard, which means that they look like thumb drives on your computer, and that's kind of how the compiler...can download software. But then we talk about an STM32. An STM32 may be a Cortex M processor. And it may be able to be programmed with Mbed, but it may not be.

CW (00:50:18):

And it may just be a bare processor we're talking about.

EW (00:50:21):

So there's just this huge confusion with the terminology.

CW (00:50:25):

Yeah, I get that. I don't know that there's a good solution besides learning what it all means.

EW (00:50:34):

Well, I wanted to go through that a little bit.

CW (00:50:35):

Okay.

EW (00:50:36):

So Arduino can refer to a specific board, the Arduino Uno, the first one.

CW (00:50:44):

That's less so these days, I think.

EW (00:50:47):

If somebody said I have an Arduino board, that is still what I would assume to have.

CW (00:50:51):

What you assume? Really? Okay.

EW (00:50:51):

Yeah. But it also can refer to...any of the Arduino manufacturer-designed boards. Of which there's the Duo, Due?

CW (00:51:03):

Due, I think. Is it? Eh, who cares.

EW (00:51:03):

There's a whole bunch of them.

CW (00:51:07):

Yeah.

EW (00:51:08):

...Arduino can also refer to anything that works with the Arduino Processing -

CW (00:51:14):

Which is everything.

EW (00:51:14):

- compiler and IDE, which includes the Raspberry Pi Pico.

CW (00:51:18):

And the Teensy -

EW (00:51:18):

The Feather.

CW (00:51:18):

- and I think actually the Raspberry Pi...I think you can kind of use Arduino in many, many places. And for different chips, different families of the chips.

EW (00:51:29):

And I mean, the Arduino Processing compiler and IDE is built on top of GCC.

CW (00:51:37):

Yeah.

EW (00:51:38):

And it is assumed that anything that works with that also can be programmed from that interface. Which is why wasn't sure that Raspberry Pi was on there, but I don't know.

CW (00:51:49):

I could be wrong.

EW (00:51:51):

It also used to mean that Arduino boards conform to the Arduino header form factor, but that isn't true anymore. So if you tell me you have an Arduino board, I'm not going to assume that it has that form factor. But if you had told me that five years ago, I would have assumed it had that form factor.

EW (00:52:10):

So these terms are super overloaded. And when people will say, "I want to use an Arduino," you're going to have to forgive me...because I start saying, "Well, tell me what that means?" And then I feel stupid because I'm like..."Tell me what an Arduino is," but that isn't the question I'm asking. It's just that these terms are so overloaded.

CW (00:52:37):

Yeah. And like I said, it's very hard to untangle. I mean, I was confused about Arduino for a long time. Mbed's a little less bad because there's no Mbed device. There's things that conform to Mbed, but they're usually normal devices that just have that as a bullet point.

EW (00:52:54):

Oh, yeah. It's so much better to say this is an Mbed board, and this is a Nucleo board as though -

CW (00:53:00):

Have you seen things that say, this is, there's no one...you don't go buy an Mbed board, do you?

EW (00:53:05):

Well, I do tell people they should look at Mbed boards.

CW (00:53:09):

Alright.

EW (00:53:09):

Which is the list of hardware that is supported, that is conforming -

CW (00:53:13):

Well, see, you're making it. You're doing it. I'm teasing. I'm teasing

EW (00:53:14):

I know. I'm just as bad. And then, Peter asked about lock-in to environments.

CW (00:53:27):

Yeah.

EW (00:53:28):

And so there's Arduino, which I don't recommend for professional use, because some of the licensing is weird. Mbed usually has more liberal licenses. But there are other platforms. You can use GCC. You can use PlatformIO, which is sort of similar to Mbed, that it's got a lot of libraries.

CW (00:53:51):

I mean, the thing that's difficult, that I think goes to lock-in is, what libraries are you using, right? And what's provided for you. The hard part about moving from one ecosystem to another is going to be how much of your code doesn't work anymore.

EW (00:54:07):

And you need a hardware abstraction layer. You need a layer that says, "I don't really care what's under here." But then that makes your code a little more complicated.

CW (00:54:16):

But if you're using Arduino, it's harder to go from Arduino to, without -

EW (00:54:20):

Well, Mbed actually,...most of the Mbed libraries look just like Arduino these days.

CW (00:54:25):

No, I was just using an Arduino as an example.

EW (00:54:27):

Oh.

CW (00:54:27):

But if you were to take Arduino and Mbed as the same thing, a pile of libraries that abstracts away most of the hardware so you can flip between boards and chips as well. If you decide that you want to go to STM32 and just do everything with GCC, you're not going to have that in the same way.

CW (00:54:43):

You still have some libraries provided by ST or whoever.

EW (00:54:46):

Or the peripherals.

CW (00:54:48):

But they're less friendly.

EW (00:54:49):

They are.

CW (00:54:50):

And you have to understand more of what's happening and how to use them. And moving from those is also fraught. So if you decide to go from ST to ESP32, you have to throw all that out again.

EW (00:55:05):

Well, there is a component of the code that you're going to have to change.

CW (00:55:09):

Yeah.

EW (00:55:10):

And...I feel like people like Peter get discouraged with the idea that there'll be locked in forever when they don't have enough information.

CW (00:55:23):

Yeah. You won't be locked in forever, but it's still work to move.

EW (00:55:30):

Yes. It's always going to be work to move.

CW (00:55:32):

And it'll be -

EW (00:55:32):

But it's work you do once. For each move.

CW (00:55:34):

It's work you do once for each move. And the difficulty of the work will be scaled by how well you've written your code, right? If you don't use good software development techniques, and things are all spaghettied together, and intertwingled with the drivers and things, it's going to be much harder.

CW (00:55:54):

If you don't have a good layering, where the code for your application, sorry for that overloaded term, but the code for the thing you want to make is not well-separated from the device, then anything that the device taints will be difficult to rewrite, going to a different platform.

EW (00:56:16):

For example, if your application involves an LED and an IMU together, and your LED depends on what your IMU does, that's okay if they're pretty high-level. But if you put your LED in your IMU driver, because it's fast, and easy, and it makes sense to put it there -

CW (00:56:39):

You're rewriting everything.

EW (00:56:40):

When you go to change it, when you go to a different IMU or a different platform with a different driver, you're going to have to change it. So if you stay at the high-level, if you stay with the drivers and libraries you get, there's a good chance you'll find different drivers and libraries that are similar.

EW (00:56:59):

Not a hundred percent chance, but I feel like it's better to get things working, to get things prototyped, to get things going, than to spin wheels and just keep thinking about, "Oh my God, what if this isn't the compiler for me?"

CW (00:57:19):

Yeah. Yeah, exactly. And there's nothing that's going to, I mean, nothing's permanent. Software is not permanent. So if you decide you made the wrong choice, it's not the end of the world to move to something else.

EW (00:57:35):

It really isn't. Especially if you're thinking about Arduino and prototypes.

CW (00:57:44):

Yeah.

EW (00:57:44):

What you're making is probably not your final code. And if it is your final code, it probably isn't your final code when you get to production.

CW (00:57:54):

Well, that's ambitious. Sometimes it's always the final code.

EW (00:57:57):

Well, yeah.

CW (00:57:57):

But yeah, don't get discouraged. I mean, this is hard. This is hard stuff. And it's hard for professionals. I mean, the landscape of devices and microcontrollers gets bigger every year, and they get more capable, and the software situation doesn't improve that much. Even though the companies keep putting out more and more stuff that sort of works, but it's all difficult.

CW (00:58:22):

And that's one reason to go back to the start of this, is that's one reason to think hard about what you want out of it. If your goal in life is to learn more about microcontrollers and things, and you have something you're making that you need to make a lot of and you have to be efficient about, then yeah. You look at something else. If your goal in life is to make small projects that help you do something else, and so you can focus on the something else -

EW (00:58:50):

Like your drum tool.

CW (00:58:51):

Yeah. That's why I'm going to use CircuitPython. I don't care. I'm not going to - and yeah, maybe a Raspberry Pi is the wrong micro for it, but I have one that's sitting here. So yeah. I'm going to use that. I'll use CircuitPython, it's got MIDI. It's a switch talking MIDI. I don't need to get excited about delving into -

EW (00:59:09):

That's a good point.

CW (00:59:09):

- CubeMX or something. Which I've done -

EW (00:59:11):

Are you building a tool -

CW (00:59:13):

Yeah.

EW (00:59:13):

- to do something else, or are you building something to learn in?

CW (00:59:17):

That's the question. That's the question I'm asking. If you're building somebody to learn in, which is what I was doing last year with the MIDI project that I was doing on a Nucleo, which was just a excuse to use ST's stuff and to get experience with that for later use professionally.

CW (00:59:32):

But for the project I want to do for my drum thing, well, I'd like to have a drum controller that I can stomp on in a week. So...I'm going to take all the shortcuts I can take and not worry about it.

EW (00:59:44):

Well, we have one more question.

CW (00:59:46):

Alright.

EW (00:59:47):

This one is from, wait a minute. Wait. Nope. I have two more questions.

CW (00:59:52):

Alright.

EW (00:59:52):

Sorry. The first is from Tom on Patreon. And he said that "the origami seems like it started, in part, as a candidate engineering design tool," meaning my origami stuff.

CW (01:00:07):

Yeah.

EW (01:00:08):

Now that I've done it, do I have any new thoughts about the engineering aspects of using it in mechanical designs? Because I did talk about the whole space idea of curved creasing -

CW (01:00:21):

Yeah, you were thinking about doing a SBIR or something.

EW (01:00:21):

NIAC.

CW (01:00:24):

NIAC, right.

EW (01:00:24):

And the curved creases allow for better stability. Oh, wait a minute. The rest of Tom's question. Okay. "Any new thoughts about engineering aspects in mechanical designs? Are there any shortcuts or tools for someone who aspires to design foldy-flexy polyimide, polyimide?

CW (01:00:48):

Polyi-amide?

EW (01:00:49):

Polyi-amide?

CW (01:00:49):

I just made that up. I'm not sure that's right.

EW (01:00:51):

Circuit boards, the flexible circuit boards.

CW (01:00:53):

Yeah.

EW (01:00:53):

Because it's now low-cost enough to use because of OSH Park's flex service. Okay. So, I haven't done a lot with the sensor system, because I am easily distracted, and paper and flex circuits are not the same. I was hoping they would have more similarities, but as I work more with different papers, I find the similarity with anything. plasticky is just not there.

EW (01:01:30):

That doesn't mean that it's not an interesting proposition, but it doesn't fold. And origami is mostly about folding. Who knew? It's more of a mechanical packaging design problem. And that I haven't been looking at. So my idea of working with flex circuits and origami would not have panned out.

EW (01:01:56):

I'm not sure that there can't be more to it, but not right now. Okay. So, really last question, Patrick, from Patreon. "How do you decide when to stop working? As a contractor/consultant, or as an employee remote working, how do you decide when the day is done?"

CW (01:02:20):

Oof. I'm going to answer this question as if it was a different time in my life, when I could accomplish more. Wow. Wait, let me, read that again? You don't need to read it again. I'm just going to, "As a contractor or an employee remote working, how do you decide when the day is done?" I mean, this could go into a whole, "How do you manage your own time" thing.

CW (01:02:45):

But I generally have a list of things I want to get done in a day. And I generally construct that on a weekly or longer basis. And so if I feel like I'm tracking to that, and I'm not going to feel too bad about stopping, then there's certain kind of stopping points that are natural. Like, "Okay, I got this portion of the code working today. That means I can work on this next thing tomorrow. It's getting toward late afternoon. Do I want to keep pushing or not? No, probably not. Okay. I'll stop. And then pick this up tomorrow."

CW (01:03:17):

And that just comes from kind of planning out the project in big enough chunks that I can divide it up into smaller chunks that are kind of daily, right? Oof. But that's kind of fallen by the wayside today, because I have some much more loose projects. So I have to force myself to kind of construct those goals. So it's become a little bit harder. And so...I find it easier to say, "Well, I'll pick this up tomorrow when I probably shouldn't be," i.s the short answer

EW (01:03:55):

If you procrastinate to the last minute, it only takes a minute.

CW (01:03:59):

Yeah, yeah.

EW (01:03:59):

Which isn't a lot to bill.

CW (01:04:01):

Yeah. Well, that's the thing, right? So you have that flexibility. There's a tension there, right? There's the flexibility where you can knock off at three and you get all your work done, but then that means you're making less money. On the other hand, you don't just want to be spinning your wheels and making the taxi fare go, because that's unethical.

CW (01:04:21):

And you don't want to charge your client for non-work. So if you're efficient, you should look for productive other things to do if you want to bill more, and not just kind of run out the clock.

EW (01:04:36):

I've had -

CW (01:04:36):

I don't have that problem, I don't, I mean -

EW (01:04:39):

I've had little clients who really needed to count pennies. And one of the things I suggest for them is to make sure their project has a long enough lead time, because there are a lot of times I will clock out, and still be thinking about it, and then they don't have to pay for that time. But if they need it tomorrow, then I have to think about it and keep going.

CW (01:05:05):

Yeah.

EW (01:05:06):

So there's some aspect of when do you need it by? And that affects how much time I work. I usually have more weekly goals, and I have weekly meetings.

CW (01:05:18):

Yeah, I have weekly meetings too.

EW (01:05:20):

But I plan out my week based on that. How far along am I to the end of the weekly goal. If I am spending three days on this client, and I'm one third of the way done on day one, then I'm probably going to knock off. I also get brain fatigue.

CW (01:05:39):

Yeah.

EW (01:05:40):

At some point, I'm just like, "I am not making progress. This is not a good use of my time or the client's money." So I have to be careful with that. And sometimes I will go for a walk or whatever, and that's a good way to both come back and get more done, as well as just being good for me. Talk about self-care. So how do I decide when I'm done for a day. Today, I said earlier today, that we should podcast today and then -

CW (01:06:15):

And then I had already just decided to take a nap. So it tells you when I decided to knock off.

EW (01:06:22):

And I then spent too long reading at lunchtime, because my book was good, and because it was sunny outside, and it was warm, and I just didn't want to get back to work. Then I finally got back to work, and Chris said, "Do you want to podcast now?" I'm like, "I really should finish this." But then I realized that I could check off all of the things that weren't the solution to my problem.

EW (01:06:47):

Because I was pretty sure I knew what the solution was, but that the solution itself was going to take an hour or two to finish. So once I was really sure that I had the solution direction, now was a good time for me to knock off, because my brain will percolate overnight to make sure that I have all my questions ready when I go to look at the solution again, and I've thought about the corner cases.

EW (01:07:10):

Now that I have eliminated all of the maybes. And so that that's a knockoff point for me is, is the next thing I need to do a big enough chunk that I don't want to finish it right now? And would the next thing I need to do benefit from not looking at it for awhile?

CW (01:07:29):

Yeah. And along those lines recently I've found that, maybe this is just the way my brain has been messed up, but I'm finding that...if I break up the time I spend on a task and do shorter bits, I'll spend a couple hours writing some code, and then I will take a long break, or move on to something else entirely, and then come back to it, I do a lot better, and I'm writing better code.

EW (01:07:57):

In part because you come back, and you have to remember what it was you were doing. And so you have to write the code well enough.

CW (01:08:02):

There's that, but I find with myself, there's kind of an impatience with, if I have a task where I want to make something happen, and I'm most of the way there, I will start to take shortcuts to make it work. So I will start with good intentions. "Oh, let's organize this code very well and have an object model that makes sense."

CW (01:08:23):

And then I'll get very close. And then I'll think, "Well, okay, I want to make this work. So let's write this method and [pbth] and then spit out some absolute trash code that works." And then it works. And then I declare victory. And then pay for it the next time, because that code is not permanent. It was a dopamine hit code.

CW (01:08:42):

When, if I had just taken a break and come back, because I was a little tired, and impatient, and I wanted it to work so that I could stop, if I just go ahead and stop and then come back, it's like, "Oh, okay, now...I don't feel like I'm rushed. I can write this code properly. I don't need the dopamine hit to just get it working." And then "Yay. I win," and then run away for the day, and then come back the next day, and regret everything I'd done.

CW (01:09:08):

Or worse, regret it weeks later, when I didn't realize that's what happened. I was like, "Oh, this code doesn't really work the way I expect. This is hard-coded." Or "This is not flexible." Or "I've got to tear this out and redo it, because yeah, it worked for this step of the project, but it doesn't fit all the steps that follow." So...that's something I have to be aware of,...and it's happened before where...it's very exciting to get things working.

EW (01:09:39):

Oh, yeah. Oh, yeah.

CW (01:09:39):

And there's a get-there-itis kind of thing that happens with code. And I think that's a source of a lot of bad code is like, "Yeah-ha! Woohoo! It works!" And "Ship it!" And sometimes you shouldn't be shipping that. And so I do find that saying, "Okay, this is close. This is a good quantity of code. I can look at this and be proud of it. We'll come back to it tomorrow. Don't worry about getting it communicating yet."

EW (01:10:05):

It's not really fair for us to answer this question because we do work hourly. We get paid hourly and we -

CW (01:10:13):

Well, that still goes for when I worked remotely at Fitbit.

EW (01:10:17):

But you and I are also lucky enough to not have to work super hard anymore.

CW (01:10:25):

Okay.

EW (01:10:26):

I mean, we're not working 60 hour weeks, and I have worked 60 hours.

CW (01:10:30):

I mean, currently we're not. I've worked some long weeks at Fitbit.

EW (01:10:36):

Yeah.

CW (01:10:36):

Which was in recent memory enough -

EW (01:10:37):

Okay.

CW (01:10:37):

-...I don't think that that wouldn't happen again somehow.

EW (01:10:44):

When I am working really long days, I have a harder time deciding when to stop.

CW (01:10:49):

Yes.

EW (01:10:50):

Because I just keep pushing.

CW (01:10:52):

Yeah.

EW (01:10:52):

And, as you said, I don't always write good code when I'm in that just keep going mode. And so there's this benefit to stopping, and not everybody gets that choice. And so you still have to think about breaks.

CW (01:11:07):

Well, and there's different kinds of work too. If you're just a code person, which is the situation we're kind of in right now, we don't have a lot of daily meetings.

EW (01:11:14):

Oh, no.

CW (01:11:14):

When I was at Fitbit or any of the companies before, I had probably two, three meetings a day on average. Plus having to do some code. And there would be -

EW (01:11:26):

This is because you let me choose the clients.

CW (01:11:29):

And, well fine. And there would be plenty of days where I was just in meetings, and I would get nothing done. And so that kind of thing, that really amps the pressure up, because you do need to get stuff done, but you also need to be in those meetings. You need to be smart in those meetings and paying attention.

CW (01:11:43):

So that's much, much more draining than if you just have a project with your contractor, the client doesn't talk to you that much, all of your time is kind of your own to schedule. It makes life a lot easier. It probably makes the quality of the work a lot better too.

CW (01:12:00):

But yeah, it's a totally different ball game if you're a full-time remote employee with meetings all the time, or even, normal amount of time, and getting to the end of the day, and realizing it's six o'clock, I've been in meetings all day. But I haven't reviewed this code from this other colleague, or I need to check this in.

CW (01:12:22):

Sometimes you have just got to do it, and you don't really get a choice, even if you're remote. So that's the thing where if you're remote, I would often try to take breaks where I could during the day. Hell, I used to do that when I was at work. I would go for a walk, when I wasn't remote, not at work. When I wasn't remote, it's like, "Okay, it's lunchtime. I got some time here. I had meetings all morning. I'm going to walk around the campus for 30 minutes or longer."

EW (01:12:53):

I've never been good at, I get in at this time and leave at that time. I'm pretty good at getting in...at a relatively consistent time. And I'm happier with myself when it's on the early side of my window, but clocking out for me really depends on what I'm working on, how tired I am and what I think I can finish before my brain stops working well.

CW (01:13:22):

Clearly we can't decide when to finish this.

EW (01:13:25):

Well, actually, there's a follow-up question. "When do you decide a job/task is accomplished and you can stop polishing it?

CW (01:13:34):

Hoo, boy.

EW (01:13:34):

As a contractor, that's a lot easier for me.

CW (01:13:36):

Yeah, that's a lot easier.

EW (01:13:36):

Because it's when the value of continuing to work on it is not there for the customer.

CW (01:13:44):

Yeah. Yeah.

EW (01:13:46):

And so for me, it's much easier. I just moved his desk. It's a stand-up desk -

CW (01:13:56):

You bumped the button.

EW (01:13:56):

- and apparently my foot moved it.

CW (01:13:58):

Yeah.

EW (01:13:58):

Anyway, it's a balance of, "Am I charging them for good things?"

CW (01:14:04):

Yeah, yeah.

EW (01:14:05):

And so, that's easier than when I was working.

CW (01:14:09):

I'm much more comfortable, "Does this do what you asked for? Yes? Done." With that sort of thing.

EW (01:14:16):

And it still has to be work I'm proud of.

CW (01:14:19):

Oh, yeah, yeah, yeah. Assuming it's good. But yeah, with contracting, I feel much more like well-defined things, they're done. It's yours. Done. God, I don't know that I had that much trouble with, because with non-contracting, everything was usually well-specified. It's like,..."Is it doing that? Does it pass the test? Yes."

EW (01:14:45):

It's also, "Have you finished writing the documentation?"

CW (01:14:47):

Yeah, yeah.

EW (01:14:49):

And put it as part of the auto build.

CW (01:14:49):

It's all the things you have to do. And if you've done all the things you have to do, then I feel good about not touching it anymore. Thank God.

EW (01:14:56):

There's a point at which "Please stop touching it so that other people can use it."

CW (01:15:00):

I mean, music is -

EW (01:15:02):

Yeah.

CW (01:15:02):

- to always bring music into it, music is the same way, working on this record. We've gotten very good at not spending weeks kind of, "Oh, it sounds a little better this way or a little bit this way" and just kind of letting sit with stuff.

CW (01:15:15):

But that can be a real problem in any endeavor, is kind of coming back and tweaking stuff. And when it's done, it's done. It's nice to have something done and not go back and touch it. There's been times it was like, "Oh, maybe we should rerecord this" song we did 10 years ago." I was like, "No, that song is what it was." And same thing with your code. If it's working, don't touch it.

EW (01:15:41):

Well, it's easy to know when this episode is done, because there'll be a Winnie the Pooh quote.

CW (01:15:46):

Thank God. Get me to stop talking.

EW (01:15:49):

Thank you for listening. Thank you to our Patreon subscribers. Thank you to our new social media -

CW (01:15:57):

Maveness?

EW (01:15:58):

Maveness? Alright, I'll go with that. If you'd like to contact us, it's show@embedded.fm or hit the contact link on embedded.fm. You can find links to the shirt on embedded.fm, unless It's not February, 2021. In which case, too late, sorry.

CW (01:16:18):

Even the Wayback Machine will not avail you.

EW (01:16:20):

[Winnie the Pooh: talking to Christopher Robin after the Woozles.]