Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
I really really dislike Arduino


That said, it is absolutely the right choice here.


A $6 NodeMCU / ESP32 dev board using Platformio, which can use Arduino is specifically the Right Choice

Adbot
ADBOT LOVES YOU

Sagebrush
Feb 26, 2012

ante posted:

I really really dislike Arduino

Got a good reason? Or is it just the grognard "if it isn't using a 555 and a thousand passives it's a waste of time"

shovelbum
Oct 21, 2010

Fun Shoe

Sagebrush posted:

Got a good reason? Or is it just the grognard "if it isn't using a 555 and a thousand passives it's a waste of time"

I haven't seen that attitude in a decade, I think more people object to locking in to an ecosystem that is probably unnecessary in an era of more powerful micros with more accessible toolchains than ever

Sagebrush
Feb 26, 2012

shovelbum posted:

I haven't seen that attitude in a decade

don't read the comments on hack-a-day

shovelbum posted:

I think more people object to locking in to an ecosystem that is probably unnecessary in an era of more powerful micros with more accessible toolchains than ever

it's hardly a lock-in; the toolchain is all open-source stuff like avr-gcc and "Arduino code" is just C++ with a bunch of macros in a file called Arduino.h. You can write assembly into an Arduino program, you can compile an Arduino .ino for nearly anything by including Arduino.h, you can even write your own makefile and do it all by hand if you choose.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

Sagebrush posted:

Got a good reason? Or is it just the grognard "if it isn't using a 555 and a thousand passives it's a waste of time"


I don't know where to start with this. That's an irritating assumption.



Try using the official Arduino IDE and use more than two different code files. Or, even, trying to use the Arduino IDE for anything remotely sophisticated.
Obviously, the solution is to use Platformio, not the official IDE.



There are also many many libraries, which is nice for beginners / prototyping, but because they are also written by either traditional developers or hobbyists, and not embedded developers, they frequently have serious architectural issues. Memory management issues and buffer problems and such.


There's more, but ehhh

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

My main problem with Arudino is the Arduino IDE...but that's because I'm used to real IDEs. It's fine for beginners to programming I guess.

Forseti
May 26, 2001
To the lovenasium!
Personally I feel like Arduino gets in my way more than it helps and the quality of libraries that you find on the internet is all over the place. I didn't like what I felt were abstractions just for the sake of abstracting without really understanding why you make abstractions. As an analogy a lot of the macros seemed to be the equivalent of a code comment like

code:
// Do this loop while i is less than ten
for(i = 0; i < 10; i++) ...
But I'm almost certainly a grognard and if someone asked me the best place to start for someone who was really interested in learning how computers really work I'd tell them to get a Commodore 64 and read its User Manual :v:

shovelbum
Oct 21, 2010

Fun Shoe
Speaking of arduinos I need to make an extremely irresponsible IoT device using a web interface to control an actuator, where can I start with this?

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
If you want to know how computers really work, buy Ben Eater's kits.

Forseti
May 26, 2001
To the lovenasium!
Not gonna lie, I'd love to build myself a Megaprocessor.

https://www.youtube.com/watch?v=z71h9XZbAWY

I could also be happy with a Magic-1 though

https://www.youtube.com/watch?v=0jRgpTp8pR8

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

shovelbum posted:

Speaking of arduinos I need to make an extremely irresponsible IoT device using a web interface to control an actuator, where can I start with this?

Get an ESP32 dev board, download Platformio, it'll allow you to generate an example blink program, and then also an example internet request program. Platformio handles all the toolchain setup and Just Works, which is kinda magic. I guess you'll also need a motor control shield, external power supply, and jumper wires.

Forseti
May 26, 2001
To the lovenasium!

shovelbum posted:

Speaking of arduinos I need to make an extremely irresponsible IoT device using a web interface to control an actuator, where can I start with this?

This is really straightforward on an ESP8266 with NodeMCU firmware. There's even an example of it in the source: https://github.com/nodemcu/nodemcu-firmware/blob/master/lua_examples/webap_toggle_pin.lua

I think it's kind of a crappy example considering it's not commented and written in a way where I'd wager the goal was "look how few lines of code this can be done in with NodeMCU!" rather than writing clear code intended to be ready by humans, but the actual documentation for NodeMCU is pretty good and it can at least be used as a reference for which functions and modules you should look up.

Sagebrush
Feb 26, 2012

If you only need the device to work on your local network, running a server on the device itself like that is probably fine.

If you want to access it from the broader internet, I would set up something like an MQTT broker with proper authentication. Either the ESP8266 or ESP32 can do password authentication but I think only the ESP32 can do TLS, which is probably desirable if this device can do anything potentially dangerous or annoying inside your house.

Forseti
May 26, 2001
To the lovenasium!
That is a good point, if I wanted to access something like that from outside the house I'd set up a VPN. But that's a whole other fairly complex thing to learn and set up.

Dominoes
Sep 20, 2007

Sage - I think the reason some posters are objecting to the arduino rec is that your initial response came across as "The arduino is the only suitable board/system to learn embedded on".

Shame Boy
Mar 2, 2010

Forseti posted:

Personally I feel like Arduino gets in my way more than it helps and the quality of libraries that you find on the internet is all over the place. I didn't like what I felt were abstractions just for the sake of abstracting without really understanding why you make abstractions. As an analogy a lot of the macros seemed to be the equivalent of a code comment like

code:
// Do this loop while i is less than ten
for(i = 0; i < 10; i++) ...
But I'm almost certainly a grognard and if someone asked me the best place to start for someone who was really interested in learning how computers really work I'd tell them to get a Commodore 64 and read its User Manual :v:

I think any hobbyist should start with arduino because it makes everything super simple and easy, and by the time it starts to feel like it's getting in the way you're probably experienced enough to ditch it and move on to just using the raw AVR libs or STM32 or whatever. It's great for initially learning stuff like "oh I can make an LED blink by turning this pin on and off" or "oh I probably shouldn't have written that code that way and now it's frozen, whoops" but be ready to move past it when you can't figure out how to do something or the thing keeps breaking in non-obvious ways or something like that.

Splode
Jun 18, 2013

put some clothes on you little freak

Forseti posted:

Personally I feel like Arduino gets in my way more than it helps and the quality of libraries that you find on the internet is all over the place. I didn't like what I felt were abstractions just for the sake of abstracting without really understanding why you make abstractions. As an analogy a lot of the macros seemed to be the equivalent of a code comment like

code:
// Do this loop while i is less than ten
for(i = 0; i < 10; i++) ...
But I'm almost certainly a grognard and if someone asked me the best place to start for someone who was really interested in learning how computers really work I'd tell them to get a Commodore 64 and read its User Manual :v:

Yeah it's neat when you've got no idea what you're doing, but it quickly becomes very opaque when it doesn't work.

Sagebrush
Feb 26, 2012

It's absolutely the best choice if you're a hobbyist with zero knowledge. I say this as a college professor who teaches students with zero prior knowledge how to get up and running with basic digital device prototyping. I teach it as a means to an end, for people who want the device to just do the thing they're imagining well enough, not for electrical engineers who are concerned with optimizing performance.

If you are concerned about things like memory management and buffers you're already past the point where you need to be asking how to get started.


Shame Boy posted:

I think any hobbyist should start with arduino because it makes everything super simple and easy, and by the time it starts to feel like it's getting in the way you're probably experienced enough to ditch it and move on to just using the raw AVR libs or STM32 or whatever.

yep

In my experience the biggest stumbling block to uptake is getting no results. Arduino lets you get the board doing A Thing in literally seconds, using a setup (install program -> plug in -> press go) that is not intimidating to newbies. If you wanna go deeper you can always do so, but when someone's new to something you should be giving them suggestions that get them quick results with a minimum of steps.

Sagebrush fucked around with this message at 22:55 on May 17, 2020

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Sagebrush posted:

The projects you've described are all digital projects, so you don't need a big pile of analog passives. You should be looking at Arduino stuff to get started.

Do you have a multimeter, a soldering setup, and an Arduino starter kit? Get all of those first.

Yeah, I have someone’s second-hand Fluke something and almost the whole soldering setup you describe (need to get flush cutters), plus a handful of different Arduino bits from SparkFun. A lot of the projects seem to involve “stick this resistor/capacitor/whatever with value X between these components”, and I’d like to develop a less cargo-culty understanding of that stuff. Plus not wanting to wait a week to try a variant on the project so I can get a slightly different component ordered. Plus plus I’d like to be able to work through stuff in Art of Electronics.

If there isn’t a good pile of starter passives to be had then I’ll scrape through a bunch of project guides and make a list myself, but I thought there might be a standard set of recommendations.

Thermopyle posted:

My main problem with Arudino is the Arduino IDE...but that's because I'm used to real IDEs. It's fine for beginners to programming I guess.

Yeah, I haven’t been thrilled with what I’ve seen of it, but as Sagebrush says it’s mostly the loading/serial tools and the library of macros. I can set up another toolchain with a better setup if I get frustrated enough.

Cojawfee posted:

If you want to know how computers really work, buy Ben Eater's kits.

His 6502 kit is in the basement, in fact!

Forseti posted:

But I'm almost certainly a grognard and if someone asked me the best place to start for someone who was really interested in learning how computers really work I'd tell them to get a Commodore 64 and read its User Manual :v:

A Commodore 64 in the 80s is what got me into this whole software mess, on a long delay.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

Sagebrush posted:

It's absolutely the best choice if you're a hobbyist with zero knowledge. I say this as a college professor who teaches students with zero prior knowledge how to get up and running with basic digital device prototyping. I teach it as a means to an end, for people who want the device to just do the thing they're imagining well enough, not for electrical engineers who are concerned with optimizing performance.

If you are concerned about things like memory management and buffers you're already past the point where you need to be asking how to get started.


yep

In my experience the biggest stumbling block to uptake is getting no results. Arduino lets you get the board doing A Thing in literally seconds, using a setup (install program -> plug in -> press go) that is not intimidating to newbies. If you wanna go deeper you can always do so, but when someone's new to something you should be giving them suggestions that get them quick results with a minimum of steps.

agreed



Subjunctive posted:



Yeah, I haven’t been thrilled with what I’ve seen of it, but as Sagebrush says it’s mostly the loading/serial tools and the library of macros. I can set up another toolchain with a better setup if I get frustrated enough.


https://platformio.org/
https://platformio.org/
https://platformio.org/
https://platformio.org/
https://platformio.org/


ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

Sagebrush
Feb 26, 2012

Subjunctive posted:

Yeah, I haven’t been thrilled with what I’ve seen of it, but as Sagebrush says it’s mostly the loading/serial tools and the library of macros. I can set up another toolchain with a better setup if I get frustrated enough.

I personally do not use the Arduino "IDE" (dunno that I'd even call it that, really) for my own projects because, like most people in this conversation, I have enough experience to run into its annoyances. But it's a hell of a lot simpler to grasp "there is a file called an .ino and you open it and that's your code in front of you" than to, say, understand the difference between a project and a solution and a file in Visual Studio. Why is my code not building? Oh it's because you have multiple projects open in your solution and you have to scope to the right one first and then build clean and aaaaaaa. In Arduino you just click the big arrow. That whole source of confusion (and many others) is just eliminated.


platformio is still too obtuse for a total newbie. It's much more powerful than the Arduino software but it's also a lot more steps from zero to blinky

Sagebrush fucked around with this message at 23:01 on May 17, 2020

Shame Boy
Mar 2, 2010

Also re these two things:

Subjunctive posted:

A few questions:
- I have a Labrador on the way, but I’m not sure if that’ll be more helpful or frustrating for actually working with. Should I find a “real” oscilloscope and function generator as well?
- someone recommended the EEZ Bench Box 3 as a power supply, so I bought the baby one on faith, but I might need other bits?

If you can afford one get a real scope, even the venerable ol' DS1054Z (with license hack to upgrade it to 100MHz) is going to be less annoying and more fun to use than anything that has to connect to a computer to show a waveform. You probably don't need a signal generator for anything you're doing, though it is fun to play with analog components and make funny noises with a speaker. That thing's probably fine for signal generation in that case.

That power supply seems very cool but also kinda overkill, you can get a good normal DC power supply without the fancy features for like $100-$150. Still, it is pretty cool and would work fine, so get it if you want.

And yeah get a good soldering iron and a few good chisel tips, the FX-888D is the current low-price thread favorite I think and has been for a long time.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
I don't think the license hack is necessary anymore. The MSO1074z I got recently came unlocked, and I think they were doing that to the DS1054z too

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Sagebrush posted:

I personally do not use the Arduino "IDE" (dunno that I'd even call it that, really) for my own projects because, like most people in this conversation, I have enough experience to run into its annoyances. But it's a hell of a lot simpler to grasp "there is a file called an .ino and you open it and that's your code in front of you" than to, say, understand the difference between a project and a solution and a file in Visual Studio. Why is my code not building? Oh it's because you have multiple projects open in your solution and you have to scope to the right one first and then build clean and aaaaaaa. In Arduino you just click the big arrow.

Oh, for sure. I’m pretty experienced as a programmer, so I don’t really need that help here. Pretty much all the Arduino explanations I see are centred around the IDE, though, so it comes across as an integral part of working with the devices in a lot of cases.

Shame Boy
Mar 2, 2010

Subjunctive posted:

Oh, for sure. I’m pretty experienced as a programmer, so I don’t really need that help here. Pretty much all the Arduino explanations I see are centred around the IDE, though, so it comes across as an integral part of working with the devices in a lot of cases.

Pretty much all the IDE does is add a secret #include line to the .ino file that you can't see, link it to a main function that sets a few things up and calls the init/loop functions, and make it easy to find libraries / run the programmer, once you figure out what it's actually doing it's very easy to translate explanations you find online that use the IDE into whatever the bespoke programming environment of your choice is.

Also seconding


for anyone that knows more than zero things about programming and toolchains already.

Sagebrush
Feb 26, 2012

If you are comfortable with setting up toolchains and programming in general, and just want to get started in electronics, I would still suggest that you start out with Arduino-compatible boards and just use either platformio or Visual Studio + Visual Micro depending on your taste. Reduce the number of points of failure. There are a billion posts about getting an Arduino Uno working with platformio and far fewer for everything else.

ante posted:

I don't think the license hack is necessary anymore. The MSO1074z I got recently came unlocked, and I think they were doing that to the DS1054z too

yeah the last ones we got for the university came pre-hacked too lol

Sagebrush
Feb 26, 2012

Subjunctive posted:

If there isn’t a good pile of starter passives to be had then I’ll scrape through a bunch of project guides and make a list myself, but I thought there might be a standard set of recommendations.

It really kinda depends on what you're getting into. For digital electronics, you can pick up an Amazon assortment of 1000 through-hole resistors for 10 bucks, the same each for boxes of electrolytic and ceramic capacitors, and a fistful of 1N004 diodes and you'll be set for just about everything. Resistors are gonna be used for current limiting or as voltage dividers, capacitors will be filters, and diodes will be rectifiers or flybacks and that's about it. Maybe add some IRFZ44N MOSFETs for running chunky devices.

If you're planning to do finely tuned analog stuff, like audio or radio, someone else with more grognardy experience will have to give suggestions. I've built some analog things and been impressed by their efficiency and speed but I wouldn't call myself an expert.

Shame Boy
Mar 2, 2010

Sagebrush posted:

It really kinda depends on what you're getting into. For digital electronics, you can pick up an Amazon assortment of 1000 through-hole resistors for 10 bucks, the same each for boxes of electrolytic and ceramic capacitors, and a fistful of 1N004 diodes and you'll be set for just about everything. Resistors are gonna be used for current limiting or as voltage dividers, capacitors will be filters, and diodes will be rectifiers or flybacks and that's about it. Maybe add some IRFZ44N MOSFETs for running chunky devices.

If you're planning to do finely tuned analog stuff, like audio or radio, someone else with more grognardy experience will have to give suggestions. I've built some analog things and been impressed by their efficiency and speed but I wouldn't call myself an expert.

Also you can find some rando assortment boxes of 74-series logic chips on amazon etc. too, probably not actually useful for too many projects these days but they're very fun to play with and see how discrete logic actually works if you're into that sort of thing.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

platformio looks amazing, thank you!

Sagebrush posted:

It really kinda depends on what you're getting into. For digital electronics, you can pick up an Amazon assortment of 1000 through-hole resistors for 10 bucks, the same each for boxes of electrolytic and ceramic capacitors, and a fistful of 1N004 diodes and you'll be set for just about everything. Resistors are gonna be used for current limiting or as voltage dividers, capacitors will be filters, and diodes will be rectifiers or flybacks and that's about it. Maybe add some IRFZ44N MOSFETs for running chunky devices.

OK, if the sourcing doesn’t really matter then I can go fishing on Amazon or AliExpress or whatever, though I’ll feel more like a grownup if I order from digikey or mouser. Amazon doesn’t have great component selection in Canada from what I’ve seen, but I’ll look again.

Forseti
May 26, 2001
To the lovenasium!
These are all fair points and I certainly am not going to hate on anyone for using Arduino. At the end of the day if it solves your problem and you're happy with it that's all that matters. I just figured I'd throw out a tool that I like and find easier to use, but you're absolutely right in that I've got a lot of experience with development in general and it can be genuinely hard to remember what it's like to start from scratch. Like I remember being completely perplexed by pointers in C/C++ but it's so second nature now I can't actually tell you what confused me about it twenty years ago.

Foxfire_
Nov 8, 2010

Subjunctive posted:

- I have a Labrador on the way, but I’m not sure if that’ll be more helpful or frustrating for actually working with. Should I find a “real” oscilloscope and function generator as well?

Ditch the function generator and add "Build a function generator" to the project list!

I would play with the little scope board until you find yourself hating it, then get either a DS1054Z or SDS1104X-E depending on how much you care about quality-of-life type issues. You probably won't need a scope until you want to watch serial buses or analog dynamics.

For parts, the only things I find actually useful to keep around without any specific preplanned purpose are:
- a bunch of through hole resistors
- decoupling caps (4.7uF, 47uF)
- connectors

For other stuff, you'll accumulate stock from buying extras of project-specific things and keeping everything organized is the biggest challenge. You'll be happier buying the right part for some application than trying to make something you already have work.

Shame Boy
Mar 2, 2010

Subjunctive posted:

platformio looks amazing, thank you!


OK, if the sourcing doesn’t really matter then I can go fishing on Amazon or AliExpress or whatever, though I’ll feel more like a grownup if I order from digikey or mouser. Amazon doesn’t have great component selection in Canada from what I’ve seen, but I’ll look again.

Generally the grab-bags are great for experimenting and having around if you need something in a pinch, and then any actual project you're doing or designing you just order specific parts for (and, since they're generally very cheap, when you need 2 diodes you order 100 diodes or w/e and start building your own stock)

Sagebrush
Feb 26, 2012

Shame Boy posted:

(and, since they're generally very cheap, when you need 2 diodes you order 100 diodes or w/e and start building your own stock)

yeah this is the real secret.

need one IC for my project? well they're only 85 cents each and I'll probably burn out one, so I need two, and I might as well buy a third in case I want to build another one of these later, so better buy 10 to save on shipping :pseudo:

Forseti
May 26, 2001
To the lovenasium!
LCSC is good for parts for hobby use and if you're in Canada they might not be that much slower than Digikey or Mouser anyway (if you get the DHL shipping). Like I wouldn't really source parts for a commercial project from them but you can get 1000 resistors from them for $2 that are fine for limiting the current through an LED. I don't think LCSC themselves would intentionally try to pass off fake parts to you but I also doubt they're going to vet and guarantee the parts they're sourcing.

That said I live in Houston so I get most things from Mouser because the cheap shipping will get here the next day and I'm impatient.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Canada Digikey and Mouser is much the same way.


I don't know how Digikey does it, but if I order before 5pm, it usually arrives before 11am the next day.

Dominoes
Sep 20, 2007

LCSC is convenient if you're having JLC make the board / SMT assembly. Prices seem all over the place compared to Digikey. I've often seen Digikey small order > LCSC > Digikey bulk order, or sometimes LCSC will be equiv to Digikey bulk.

In southern US, Digikey takes me about a week order to arrival using the cheapest shipping. I'm with you on the constantly needing to try a diff part, then bottlenecked by the wait. Doesn't hit as badly when you plan things properly. Not great for when you're experimenting, since it can turn into a chain or try/wait cycles, or buying things you probably don't need as a preventative measure.

Dominoes fucked around with this message at 23:55 on May 17, 2020

Shame Boy
Mar 2, 2010

Dominoes posted:

LCSC is convenient if you're having JLC make the board / SMT assembly. Prices seem all over the place compared to Digikey. I've often seen Digikey small order > LCSC > Digikey bulk order, or sometimes LCSC will be equiv to Digikey bulk.

In southern US, Digikey takes me about a week order to arrival using the cheapest shipping. I'm with you on the constantly needing to try a diff part, then bottlenecked by the wait. Doesn't hit as badly when you plan things properly. Not great for when you're experimenting, since it can turn into a chain or try/wait cycles, or buying things you probably don't need as a preventative measure.

Arrow still does the free overnight shipping on orders over $50 thing I think but who knows how long that'll last.

Splode
Jun 18, 2013

put some clothes on you little freak
The biggest problem with Arduino is you learn very little. If you did actually buy the ST dev board and suffer though cube mx to get it running, you now know more or less how to get any micro going, at a professional level. If you stick to Arduino you learn nothing except how to use Arduino. The default IDE doesn't even let you click through and see how the Arduino libraries work, which is terrible for new people. I've used platform io and it's a bit janky. If you can handle that you can handle normal IDEs and professional environments that don't do as many weird things (Arduino having a single copy of it's libraries shared between projects? Why??)

Don't get me wrong, I started with Arduinos, but in an educational setting I learnt way more way faster from using the real thing.

Sagebrush
Feb 26, 2012

Splode posted:

The biggest problem with Arduino is you learn very little. If you did actually buy the ST dev board and suffer,

I'm rolling my Professor Eyes extremely hard at this attitude.

Splode posted:

If you stick to Arduino you learn nothing except how to use Arduino.

Oh no!

Adbot
ADBOT LOVES YOU

Dominoes
Sep 20, 2007

Arduino's overrated!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply