starting with nodemcu/esp8266 dev board - esp8266

I have a esp dev board that I've been trying to get to work, but have faild miserably. after spending a few days trying I was able to 'flash' a firmware and up load code(to connect to my wifi) via arduino IDE. the problems are when I open the serial monitor the serial monitor window is nowhere to be seen(it refuses to show up on my desktop, but if I place my mouse over arduino IDE on the task bar I can see a tiny version of the window with what seems like the esp is supposed to tell me). I verified the wifi program was working with advanced ip scanner. The other problem is that when I try to use esplorer I am told the following:
Communication with MCU..Got answer! Communication with MCU established.
AutoDetect firmware...
Can't autodetect firmware, because proper answer not received (may be unknown firmware).
Please, reset module or continue.
à‚3þÿÖ
ü
I've tried reseting via hardware and software and also saving a init.lua to the esp ( which I am told: Waiting answer from ESP - Timeout reached. Command aborted.)
Is there an easy step by step tutorial or something where I can get this thing to work in such a way that it is possible to develop with it? I dont care what language I have to use as long as I dont have to spend more time on trying to get the hardware to work. For something that is Arduino-like hardware it is significantly harder to do the simplest thing, a pic mcu is easier.es

If you are doing serious IoT thing then, I guess its better to go by Espressif IDE. There's a Freetos version also available which makes programming experience better.
To get started step by step you can check lot of videos on youtube, that's my preferred way of getting started. I found these three helpful to get started : here

Related

ESP8266 flush program after power lost

I program my ESP8266 with a Arduino Uno and this guidance: Programming the ESP8266 With the Arduino IDE in 3 Simple Steps
Wifi connect, Mqtt connect (subscribe, publish, callback) everything works fine and totally like expected.
But after I disconnect the power from the Arduino Board and reconnect to a another V3.3 power source, the ESP8266 behavior is like a complete clean flushed device and nothing happens.
For programming I use this settings (Arduino IDE 1.8.12):
What I am doing wrong here?
EDIT
1.) I try two different ESP8266, and 3 different scretches (1. proved working in the past, 2. simple blink sketch, 3. sketch with my code I need)
2.) the program stops immediately after disconnecting CH_PD from 3.3V
3.) I update the esp8266 board package to the newest version 2.6.3
The main issue here is my bad documentation. After a long time, I found the solution again here: Easiest ESP8266 Tutorial (Using arduino). Like the first time two years ago. In conclusion, I forgot to disconnect GPIO0 from GND after programming.
The correct way after programming is:
disconnect arduino
disconnect gpio0 from gnd
connect power to esp8266
Thanks to LiveSparks creating and uploading this great video.

Is it possible to access a Chromebook via ssh through USB?

My employer has asked me to prepare for testing several thousand Chromebooks (mix of models/manufacturers) to refurb/flip. This may be a recurring thing.
Most or all of these will be old enough that CCD will not be available. I'd like to connect a widget such as a Raspberry Pi to the USB and have it automate testing as much as possible.
I know I can use keyboard emulation to inject commands, but I'd like to get a crosh session running over USB so that I can read info from the DUT besides just controlling it.
Google shows bazillions of returns about using a Chromebook as an ssh terminal but what I'm looking for is the opposite. I'm prepared for the answer to be a simple "no" but I'm concerned because I can't find that anyone else has asked this question. I don't think I'm that creative, so I suspect my Goog-fu is weak.
The answer appears to be "no". However I solved it another way; using "gadget mode" I have a Raspberry Pi ZW enumerate as a keyboard and a serial port. I put the Chromebook into Developer mode, open a developer shell with ctrl/alt/F2, or on a PC/linux or Mac system open a terminal window and type "sudo su" (these have to be done manually). Then I have the RPi issue this bash command to identify the serial port "in the blind":
SERPORT=/dev/serial/by-id/$(ls /dev/serial/by-id) # Chromebook or PC/linux
(or)
SERPORT=$(ls /dev/cu.usbmodem*) # Mac
Now I can have the RPi inject commands via the keyboard, put ">$SERPORT" on the end of each command, and the output comes in the RPi gadget serial port. The RPi then packages the data and forwards it over WiFi to our CRM. It's working nicely for Chromebooks, PCs booted into linux, Mac desktops and Macbooks.
Edit:
The company I work for has actually turned this into a product and so I'm not sure how much detail I should share, but...
I learned my way around gadget mode on the RPi from this link. There are examples for setting up a keyboard and a serial port. Using the templates in that link, I made a device called /dev/hidg0 which emits keyboard scancodes from the RPi to the Chromebook. I also made a device called /dev/ttyGS0 which the Chromebook sees as a serial port.
So I send keystrokes with some python like:
with open("/dev/hidg0","bw") as hid:
hid.write(blah)
and then have the Chromebook send text to the serial port, which I then read by looking at /dev/ttyGS0
Hopefully this will be enough to get you started. I found the isticktoit link very helpful.

looking for alternative solution than IPFW for slowing down an internet connection

I need to slow down (simulate bad) internet connection, I found some documentation where it was achieved by "ipfw pipe" command , the thing is that in latest MAC OS versions , ipfw was deprecated (and removed)...
I was wondering if there are any alternative to the ipfw API ?
Does anyone know how latest Network Link Conditioner achieves it?
The original previous way which enabled to slow down an internet connection :
sudo ipfw pipe 1 config bw 56Kbit/s delay 200 plr 0.2
and to clear the pipe :
sudo ipfw delete 1
Thanks.
I don't know much about Mac OS (I use Linux myself), but I'll give this a shot.
A bunch of digging established that ipfw seems unavailable, as you say.
I was also unable to find a way to use the Network Link Conditioner from the command line. Everything should be usable from the command line, so that's stupid.
One work around would be to try to access the NLC from within AppleScript. The following will get you started on toggling the NLC:
property thePane : "com.apple.Network-Link-Conditioner"
tell application "System Preferences"
activate
set the current pane to pane id thePane
--delay 2
end tell
---
tell application "System Events"
tell application process "System Preferences"
try
click ((checkboxes of window "Network Link Conditioner") whose description is "enable switch")
on error
click ((checkboxes of window "Network Link Conditioner") whose description is "enable switch")
end try
end tell
end tell
I think that you can run a script from the terminal with osascript <SCRIPT>.
As an alternative, Charles Proxy is a pay-to-use program that can be used to perform throttling, provided you can convince the software you are testing to connect to the proxy's port rather than directly to the internet. Maybe there are free proxy solutions out there somewhere?
Perhaps Squid would work in that regard. SquidMan seems to be an easy-ish way to install it for Mac. It looks as though DelayPools and or Client Bandwidth Limits might be useful for simulating a low speed connection, though I can't find evidence of people having used them for such.
I found several solutions that might work. They come from some old threads, but they might help:
How to simulate slow internet connections on the mac
Apple has made a very handy official tool to slow down the network connections on you Mac for testing purposes.
The Network Link Conditioner preference is a free download from within Xcode (for Lion and later OS). Additionally, iOS has similar function accessible from within Xcode and iOS 6 or later.
How do I simulate a bad Wi-Fi connection on my iPad?
There are a few ways you can do this, depending on your situation:
Move further away from your router. While this may seem a bit obvious, I realize that it isn't always possible while testing/debugging (for example, if you are working on a desktop computer).
Put aluminum foil around the router and/or antenna. This will (partially) block some or all of the radio signals by creating a makeshift Faraday cage. The results you get will depend on the strength of your router signal, distance from the router, and other environmental factors.
Set your router's wireless signal power to a lower setting. The method for doing this is different for each router, so you will have to look at the user guide for instructions on how to do this.
Slow down internet for iOS simulator
You can set the network to slow characteristic by testing on devices. Go to Settings -> Developer Settings -> Network Link Conditioner -> Enable. This is for iPhone/iPad running iOS 6
I don't know if the last one you can still do.
I've used many methods in the past for slowing down network connections, among them:
performing a parallel download of some massive Linux ISO file;
physically pulling out the Ethernet cable (at one point, I actually toyed with the idea of building a push-button device that would sit between two cat5 cables and do this without having to physically disconnect the whole cable).
using ifconfig eth0 down ; sleep 1 ; ifconfig eth0 up.
Hopefully one or more of those methods will help.
If you're looking to slow down your network connection because you're doing testing/profiling work, one option is to get a specific device that can create network latency/noise.
For example Apposite Tech's mini2 WAN emulator allows you to change values for bandwidth and packet loss. You can roll your own device too using something like: http://wanem.sourceforge.net/ . It just depends on your needs, time and budget.

How to troubleshoot CAN bus communication

I am trying to connect ICP CON i-7565 (USB<->CAN interface) to a custom made device (supporting CAN2.0B, proved to work with PCL-841 card) Although I think I have configured BAUD and acceptance code/mask correctly I can see CAN no messages coming from the device (ICP provides a tool that should allow me to send and receive CAN messages).
I am new to CAN bus so I appreciate any help regarding how to identify the problem.
I-7565 might be wrong interface for me, I might have misconfigured it, or it is simply broken. Or I am just doing something wrong out of my ignorance. I don't think anyone can help me with my specific problem, so I am rather asking for general information on how are problems with CAN bus identified and analyzed. In TCP/IP for example, you would call ping, you'd recheck your ip and gateway settings etc. What do you do for CAN communication?
Additional info:
OS: Win7 64bit
connector: DB-9 with standard wiring (2,3,7)
Finally I tried to work with different USB<->CAN interface from different manufacturer and it worked like a charm. My old interface was either broken or incompatible for reasons unknown. While working on this problem I learned couple of things about CAN bus and so now I share what I think was the right answer to my original question: How to troubleshoot CAN bus communication?
read manual to your USB-CAN interface
install driver of your interface device and make sure it is working (check device manager, depending on the type of your device you will see new COM port added or new USB controller )
your device should be shipped with it's own test/analysis software (they might call it utility or similar), run it and check if it can connect to your device
CAN communication uses three wires that are referred to as High, Low and Ground and is usually connected with DB-9 connectors where High is linked to pin n. 7, Low to pin n. 2 and Ground to pin n. 3 or 5 - make sure this is connected correctly on both your USB interface and CAN device you want to communicate with
set properties of your connection, these are most of all: CAN type (2.0A or 2.0B) BAUD rate, Acceptance Code and Acceptance Mask
if you've done all of this and still you can see no CAN messages arriving in your utility program, check with a different USB-CAN interface or find some other way to test if your device is actually emitting CAN messages and your USB interface is in fact able to receive them. (this was actually my case)

iOS virtual button to Arduino

What would be the best way of sending a signal from an iPad to an Arduino?
I am trying to use XBee, with iPad and Arduino to send a wireless signal.
I want to make a big red virtual button on an iPad that, when pressed, turns on an LED on the Arduino.
I am a total newbie when it comes to iOS, but OK with Arduino and XBee.
So I'm not sure if I understood correctly, but in my meaning there is only one simple way to solve the problem:
Connect an XBee to a Computer and another to the Arduino. On the computer you launch a webserver, which will be accesible from the iPad over Safari. This server handles the clickes and writes to the XBee Com Port, for communication.
Here are some examples, people already made:
http://www.projectallusion.com/1/post/2009/11/iphone-controlled-solar-powered-arduino-tank.html
http://www.sparkfun.com/tutorials/152 (not with xbee, but you can implement that by yourself)
I know it's been a while but I just came across to this question and yesterday I was doing the exact same thing so I'll share the method I used and the source of it.
In order to set a LED on or off in an Arduino board from the iPad you really don't need anything more than a browser. This is of course if you have a way to connect that Arduino to the local network.
Today you have at least two options. The WiFi and the Ethernet shields. Once you have your Arduino board inside the network you can send the instructions (HIGH or LOW) to the board form the browser.
These are my two boards connected waiting to be plugged to the local network:
Of course, you'll have to code the board to process those instructions. There are many examples on how to configure network settings and state instructions:
If you have a bit of time and want to do something more elaborated you could create a simple app to graphically control the state of those LED(s).
Inside you'll basically do the same thing, create the URL command and send it to the Arduino IP but it'd look much nicer. If you integrate later more controls the sky in the limit.
My experiment is a combination of what I learned from this nice tutorial and some tips I've read here and there.
I hope it becomes also useful to someone else.
Cheers,
Since you need to use a network connection from the iPad, a possibly simpler way to do this would be to use a WiFi module on the Arduino to poll a web script, and have the iPad write a state (button press) to that web script.
There's a handy WiFi module called the RN-XV that's designed like an XBee. I wrote up two tutorials on it:
http://log.liminastudio.com/programming/getting-started-with-the-rn-xv-wifi-module-node-js
http://log.liminastudio.com/itp/physical-computing/using-the-rn-xv-wifi-module-as-a-remote-switch

Resources