|
このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。 |
The Sparkfun ESP8266 "Thing" (link to Sparkfun 製品 description) has been around for a while now. It is just one of many ways to enjoy the ESP8266 半導体素子.
(This page also has a few 発言/述べるs about the Adafruit Feather Huzzah 8266... and yes, you need all three parts of that!)
I was wrong to be so 冷笑的な, and lazy and not give it a try before I did... in December 2016.
There are 現実に two very 類似の 製品s on sale from Sparkfun. The one I've played with is the ESP8266 Thing Dev Board, Sparkfun part WRL-13711. (Same price as other, the "plain" "Thing", Sparkfun part WRL-13231. ($17 at 7/21. ($16 at 12/16)))
It is a little bit like an Arduino (which I have a lot of experience with, because I think Arduinos are very 有能な... and fun!)
8/21: I have now played with the Adafruit Feather Huzzah with ESP8266. It Just Ran an old program I had for the Thing, first time. (That isn't, of course, to say there are no differences! The Huzzah has 8x the momeory of the Thing, but there may be いっそう少なく welcome differences, too. (512k bytes (the Sparkfun, at 8/21, is NOT "too little"... the app I tried that 作品 in both runs a webserver to 監視する two 反対するs, two 気温 sensors. (I 港/避難所't 大(公)使館員d sensors, or fed inputs to the 反対するs in the Huzzah yet, by the way... but that's trival compared to the web-serving... which I HAVE 実験(する)d.)
As I said, there are two very 類似の 製品s. To shamelessly and without attribution copy someone else's work, the differences are...
If you are looking at the 最高の,を越す 味方する of the board, at the end with the big "Sparkfun" text, if you see "ESP8266 Thing"... without "Dev"... you have a WRL-13231. If you see "ESP8266 Thing Dev", you have... (if I have to tell you, I can't help you! Other than to 確認する that the number of the Thing Dev is WRL-13711). Of course, if you remember (as I did not) that one (the Dev) has a USB connector and the "plain" thing does not, then you can see what you have from that, too.
(Several paragraphs of tweaked 引用する begin)..."The major difference between the "plain" Thing and the Dev Thing is that the Dev has a USB-to-Serial converter on board. This means you don't need a FTDI cable or 代案/選択肢 USB-to-Serial converter to program the board, or さもなければ communicate with a USB host.
"The 半導体素子 at the heart of both Things, the ESP8266, has a reset-from-sleep pin which is neatly broken out to pads where you could connect something to connect it with the Reset signal. (The "plain" Thing (WRL-13231) needs a wire soldered from 中央の-board RST to XPD on the 味方する.)"
(The person I'm 引用するing goes on to say...) "And it has a different 回路・連盟 to 自動車-reset and 自動車-program. I 港/避難所't 人物/姿/数字d out how this 作品 yet."(END of several paragraphs of tweaked 引用する.)
"An Arduino" with everything you need to connect 経由で WiFi "built in". And it will run off of 2 AA 独房s, or LiPo 力/強力にする.
Just before I go into why I like it so much, let me について言及する that I've written a separate page to cover the topic of the Thing's analog input pin ("ADC").
A little "aside" before I proceed: It must be said that Sparkfun is rarely the cheapest source for anything. But in most 事例/患者s, I find the 賞与金 very modest, 特に when you consider the advantages of 取引,協定ing with Sparkfun.
In the 事例/患者 of ESP8266 based systems, it is true that the Sparkfun 製品 is "expensive"... $17! Oh dear!... and it isn't the most powerful ESP8266 out there, nor is the board 特に generously 供給するd with memory/貯蔵.
Humor me. Start with the 装置 名簿(に載せる)/表(にあげる)d here. It 作品!. You may want to use the Sparkfun documentation.
Once you are no longer an ESP8266 newbie, if you want to play with eBay wonders, 罰金! By then, you'll be in a better position to decide between "欠陥のある module" and "Programming Error".
While revisiting this, 7/21, I (機の)カム across an 代案/選択肢. Also from a major 供給者 of Arduino-両立できる 道具, Adafruit. They 申し込む/申し出...
"Feather HUZZAH WiFi 開発 Board", their 製品 number 2821 for one with the headers. Built in USB and 殴打/砲列 非難する.
The Sparkfun "Thing" may match some of those specs... I 港/避難所't taken a 罰金-toothed 徹底的に捜す to this! (Yet.)
Annoyingly, unless I am blind, the off critised memory/貯蔵 of the Sparkfun Thing isn't (疑いを)晴らす on it's page. On my second 試みる/企てる to find it, 8/21, I 跡をつけるd 負かす/撃墜する 確定/確認 that it is still only 512k BYTES. If you look at the schematic, and 人物/姿/数字 out that U3 is the memory, and 跡をつける 負かす/撃墜する a data sheet you may see "4M"... but 公式文書,認める that's 4 mega BITS. Which is 512k BYTES. I still 港/避難所't 跡をつけるd 負かす/撃墜する the Thing's 加工業者's clock 率.
Don't get me wrong. More is not always better. 512k is FINE for the little webservers I've created. I like the Thing. I like Sparkfun. (My first 遠出 at the Adafuit "support" 会議 has been disappointing. Sparkfun support excellent.) But you should know what your choices are.
But to Sparkfun's credit, I think that they say somewhere that the Thing's (Plain and Dev) pins are happy with 5v inputs. Adafruit doesn't, that I see, 演説(する)/住所 the "問題/発行する"... which may or not be an 問題/発行する, in what you want to do. But you do need to 支払う/賃金 attention to the 3v3 vs 5v question, always.
Okay... "What's it good for?" One thing you might use the "Thing" for is an Arduserver. (That link... the one in the previous 宣告,判決... takes you to an overview of the Arduserver 概念. If you want sourcecode and 詳細(に述べる)s of an Arduserver hosted on an ESP8266, use the link in this 宣告,判決.)
The ESP8266 is "good" and "bad". "Good" in that it opens the way for some amazing 事業/計画(する)s. "Bad" in that the best of those will 伴う/関わる 多重の 科学(工学)技術s... "Arduino" (type) programming, WiFi, html, etc.
So maybe if you are learning "everything" at once, it won't all be "平易な"... but even if you are new to some of the several threads to this story, the Thing is a good place to start. And if you "don't make it" (for now), the 演習 will only cost you $17! When I first tried to connect an Arduino to a LAN, by a mere "wired" 関係, the cost of 入ること/参加(者) was a lot higher. (And you'd still have a useful Arduino... you don't HAVE to use the WiFi part!)
Setting up, using a 装置 in a LAN 状況 will never be "simple", even a wired 装置, let along something WiFi.
But I can't imagine it 存在 easier than the ESP8266 "Thing" makes it.
My Arduino IDE, on the machine I 実験(する) untried 装置s on, was a little 年輩の 支援する in February 2017, and resisted 昇格. A nuisance. And 全く 関係のない to the 長所s or 証拠不十分s of the Thing. I only について言及する it, as that was by far "the low point" of my first day's play with the 装置. (And it 限られた/立憲的な the time I had for playing with it.)
Even with keeping my 記録,記録的な/記録するs of static IP 演説(する)/住所 assignments, and port usage meticulously up to date (VITAL!), AND starting a "How To" essay, I went from the end of first running Blinky (make the LED wink) to having a web server active on my LAN in about a half hour. It ran FIRST TIME. (And every time afterwards, too.)
Be sure to try changing the upload 速度(を上げる) used to program the board.
You do this with the IDE's 道具s/ Upload 速度(を上げる) item. It "作品" at the default 速度(を上げる), but you soon begin to seethe while the upload 進歩s. 始める,決める the 速度(を上げる) too high, and you'll get the 時折の failed upload. No big 取引,協定... just invoke "upload" again. I've been uploading at 512,000 without getting failed uploads.
The Sparkfun ESP8266 runs at EIGHTY megahertz. Be 用意が出来ている to 再考する what you consider "normal" for 死刑執行 速度(を上げる), if, like me, you come from EIGHT megahertz Arduino プロの/賛成の 小型のs.
It "shouldn't" happen... but if it does:
You may find that you get "initHardware not 宣言するd within this 範囲" (or 類似の) when you go to make a minor change to something that was working just 罰金 a moment ago.
Try moving the code for your "体制/機構()" and your "宙返り飛行()" 負かす/撃墜する to the 底(に届く) of you code, if you get something like the above.
-----
While I've interrupted myself already: I have used the good 構成要素 at....
the excellent www.elec-cafe.com essay about using DS18B20 with ESP8266.
.... to put a DS18B20 気温 sensor on my Thing. Went 井戸/弁護士席. Working 罰金. These Dallas 1-Wire sensors are excellent. The 気温 sensors seem to be the most 広範囲にわたって used, but there are other 装置s... sensors and actuators... in the 1-Wire family.
I will try to get a "how to" out for you in 予定 course. In the 合間, the 合成 of the elec-cafe 構成要素 and experience can be 設立する in the code of my ESP8266 Arduserver. (That link was given to you already above. Don't visit twice, if you already went!)
-----
支援する to our story...
Yesterday (first day) I was working only a few メーターs from my WiFi base 駅/配置する. Today, I was glad to be alone in the building, as I felt a little foolish going from distant room to distant room with my Android in one 手渡す, and the ESP8266 in the other, seeing if it would still serve pages, "distant" from the base 駅/配置する.
The Android's signal strength メーター was usually showing a very poor signal... but the Thing served pages from three different 場所s with never a fail. And I was only using the "baby" antenna etched into the 跡をつけるs of the PCB. There is a 関係 for an 外部の antenna if you want to 延長する the 装置's 範囲. The 場所/位置s were about 15 メーターs from the base 駅/配置する, いつかs between rooms on the same 床に打ち倒す, いつかs between rooms AND 床に打ち倒すs. いつかs very 相当な masonry 障壁s... pierced by doorways... were in the way. As I say... my Samsung Android was struggling to see the signal, but it was 適する for the Thing.
---------
I prefer to put such things on a 直す/買収する,八百長をするd IP 演説(する)/住所 within the LAN. 平易な! I'll explain in a moment. Also, unless you don't already have a web server on your LAN, you probably want to tell your Thing to serve on a different port.
Starting with the basic Web Server デモ from the (excellent, by the way) 中継 guide at the Sparkfun website, I had, as everyone will, to change the values in...
////////////////////// // WiFi 鮮明度/定義s // ////////////////////// const char WiFiSSID[] = "WiFiSSID"; const char WiFiPSK[] = "WiFiPSK";
If my Wifi's SSID were MySSID, and the password to get in were MyPassword, I would need to make the above...
////////////////////// // WiFi 鮮明度/定義s // ////////////////////// const char WiFiSSID[] = "MySSID"; const char WiFiPSK[] = "MyPassword";
Changing the port the server operates on is an even simpler 事柄... just change the "80" in the に引き続いて to what you want used....
WiFiServer server(80);
And now, I can return to the question of making the 装置 use a 明確な/細部 IP 演説(する)/住所. The デモ code, as 供給(する)d, asks the LAN's DHCP server to 割り当てる an IP 演説(する)/住所.... AND, if you look at the (警察などへの)密告,告訴(状) coming up 経由で the Arduino's serial 監視する, it (the Thing) tells you the 演説(する)/住所 it has been 割り当てるd for this 開会/開廷/会期.
But as some will know, and others will learn, that really isn't a good 解答 for some 状況/情勢s. The "problems" are nothing to do with the Thing. They would arise with ANYTHING you 手配中の,お尋ね者 to put "on the internet". I go into them やめる a bit in the Arduserver 構成要素.
So... can the Thing be made to "sit" at a programmed IP 演説(する)/住所? Yes! Easily! A "天然のまま" 見解/翻訳/版 would entail even いっそう少なく than you see here, but, with a nod to Good Programming Practice, the bits you need to change from program (or 環境) to program/ 環境, are 存在 put up at the 最高の,を越す where they are 平易な to find. The values are going into 井戸/弁護士席 指名するd "variables". (I put that in 引用するs, because the value won't change in the course of the program running.) And then, when those values are needed, they are 供給(する)d by 挿入するing the variable where the value is needed.
So! First the variables and some hypothetical values. This 封鎖する can go just after the "WiFi 鮮明度/定義s" 封鎖する, which was 類似の...
//THREE LINES ADDED BY TKB TO BASIC DEMO.... 封鎖する 1 of 2 to 始める,決める static IP 演説(する)/住所 IPAddress ip(192, 168, 0, 240); IPAddress gateway(192,168,0,1); IPAddress subnet(255,255,255,0);
The only value you are likely to want to change is the 240... but your LAN may be 慣習に捕らわれない, and 要求する other tweaks.
Once those are 利用できる, you need to 挿入する...
//ADDED TO DEMO BY TKB... 2 of 2 to 始める,決める static IP 演説(する)/住所 WiFi.config(ip, gateway, subnet);
... just before the...
WiFi.方式(WIFI_STA);
.. which is part of 無効の connectWiFi()
-----
That's it! Just get yourself a Dynamic DNS URL and take care of your router's NAT (米)棚上げする/(英)提議する, and your little $17 webserver can be seen by the world!
I was able to put the Thing on the 世界的な internet with little hassle, but I was only 追加するing it to some other 類似の things on an 存在するing 取り付け・設備.. several "do once" things were already done. "Just" taking care of the two things I 解任するd as little 詳細(に述べる)s in the previous paragraph will be a bit of work the first time you do it... but....
-- 1) They are things you have to do to connect ANYTHING on your LAN for 接近 by the wider world.
-- 2) It costs nothing, or almost nothing. ("almost nothing" saves you minor hassles.)
-- 3) Once you've done it for one 装置, it is much easier to do again, for the next 装置.
-- 4) It isn't ロケット/急騰する Science.
Anyway... have a lot of fun with the Thing INSIDE your LAN, you don't have to 取り組む those things. Get it working on the LAN first. Then 始める,決める out to 征服する/打ち勝つ the (internet) world.
The illustration below shows two instances of essentially the same 回路・連盟... an ESP8266 with some bits and pieces (and ソフトウェア) making it an "Arduserver"... a "proof of 概念" デモ参加者/実演宣伝者 for people 利益/興味d in getting started with "Internet of Things" 事業/計画(する)s. Connect to the ESP8266 from anywhere on the internet, turn things on and off, see what sensors 大(公)使館員d to the ESP8266 are "seeing".
The one on the left was 始める,決める up easily, and can be tinkered with. The one on the left is more 強健な, and doesn't tie up a breadboard. (Don't take either as 正確に/まさに 権利, and a "model"... but both are nearly what I ended up with. Both work now.)
Both feature "反対するs"... not part of the basic Arduserver. Both 報告(する)/憶測 their data not just in human-friendly form, but also in machine-friendly form. You can use a program to 監視する the values coming from the sensors, draw graphs, 記録,記録的な/記録する data とじ込み/提出するs, raise alarms if a parameter gets out of spec.
What is your time 価値(がある)?
A nice person going by the tag "uChip" created a useful little (2.5 x 5 cm) PCB. It is a protoboard for the "Thing". Use it with Things which have sockets on the 最高の,を越す, or pins on the 底(に届く), depending on your wants. (You have to 始める,決める the protoboard up accordingly.)
It is a 'public 事業/計画(する)' at OSH Park. Costs only $10 for the 最小限 order of three. (p&p 解放する/自由な to anywhere in the world, and service, at least US/UK is 早い.) I not only buy this sort of thing from OSH Park, but also have my own boards made by them. Very 満足な.
Here's a rough guide to what the board 申し込む/申し出s. The guide has not been extensively 実験(する)d. Let me know, please if you 位置/汚点/見つけ出す mistakes.
(The IDs on the pads is a work in 進歩. 現在の best "for printing" artwork will not always agree 正確に/まさに with what you see below... but it will be my 最新の 成果/努力 to Get It 権利.)
At the upper left, some pads for a 力/強力にする 供給(する). I 港/避難所't 調査/捜査するd this, the "TI" is for "Terra Incognito".
支払う/賃金 attention:: There are 5 pads I've 示すd with a white blob with a 黒人/ボイコット 位置/汚点/見つけ出す in the 中心. **They are all connected to one another**.
And then there are the 16 pairs of pads which I've 示すd with short vertical cyan lines. The pads of each pair are connected to one another, but not, as far as I have seen connected to anything else.
As far as I have seen, all of the other pads are singletons.
I used one of these proto-保護物,者s to create my third ESP8266. (Feb 2017) It went very 井戸/弁護士席. I even 追加するd some features. 強健な, and doesn't tie up a breadboard, as so many of my "I'll finish that later" 事業/計画(する)s do, sigh.
Some say that 512k is too little. I say I can have a lot of fun in 512k at $15. Of course, if Sparkfun can 増加する the memory, at about the same price, who's going to complain? (At 8/21 I 設立する it very hard to find anything about the Thing's memory. 結局 I went to the schematic, and then used Google Search to 調査/捜査する a "mystery 半導体素子" which turned out to be a "4Meg" 半導体素子... 512K x 8 bits... so a 512 mega BYTE 半導体素子. Who cares how many BITS (1/8th of a byte) something has? Sigh.) The Adafruit Feather Huzzah with ESP8266 makes it's memory complement very (疑いを)晴らす: "4MB of FLASH (32 MBit)"... 8x what the Thing has. And they 明言する/公表する the memory "up 前線".
Some say that even at $15 it is too much. I like doing 商売/仕事 with someone I can go 支援する to. I like supporting them because they bring me nice toys, with good documentation. I like 存在 able to do a lot of shopping in one place, and know when my 小包 will arrive. Do I buy everything there? No.
There aren't many I/O pins. No, there aren't. And my Arduino プロの/賛成の 小型の doesn't have built in WiFi.
Minor 詳細(に述べる): The ESP8266 供給するs you with an LED onboard. Already 麻薬中毒の up to one of the GPIO pins of the 加工業者. Almost like the LED on D13 of a 伝統的な Arduino. However, instead of 存在 on D13, it is on D5.
If you see things in my sourcecode like...
digitalWrite(PIN_LED, HIGH); // LED off 延期する(5); digitalWrite(PIN_LED, LOW); // LED on
The comment may be WRONG... "HIGH" may lead to on, "LOW" to "off". (I was a bit muddled about something, AND had an LED wired strangly.)
The 見解/翻訳/版s of the diagram below has a little new (警察などへの)密告,告訴(状), was tidied and I changed the colors to be kinder to your printer, if you want to print out some copies as "worksheets" for designing or 文書ing things you put on one of "uChip"s "Thing Proto 保護物,者"s...
There are many 平易な ways to print from a web-page, if you 港/避難所't already discovered this. 権利 click on the image for starters, and after that what's easiest depends on your system's 体制/機構 and wants. I just used "見解(をとる) image", and printed from the result of that without hassle.
The 任命s of what signals are on each pad is a work in 進歩. The text in the silkscreen of the actual PCB, as 購入(する)d 1/17, doesn't 正確に/まさに agree with the silkscreen on the Sparkfun ESP8266 "Thing", Dev Board. 購入(する)d 12/16. BUT THIS ISN'T A BIG DEAL! When you've used Arduinos and the like for a while, you will come to see this as "決まりきった仕事".
I have started a little page to discuss "special circumstances" on some ESP8266 pins, for instance the fact that on the Sparkfun "Thing", on the PCB, there's a LED 大(公)使館員d to data line 5. (Not that the LED on line 5 is a "big 取引,協定"!)
Please get in touch if you discover 欠陥s in this page. Ways you are using "the Thing" would be of 利益/興味, too. Please について言及する the page's URL. (www. thingie)
If you 設立する this of 利益/興味, please について言及する in fora, give it a Facebook "like", Google "加える", or whatever. I've almost given up 令状ing these pages, because it seems they are seldom read, and of course not every reader will use them... so... is there any point? If you want more of this stuff, help!?
Click here to visit my main homepage where you
can 調査する other areas, such as education, programming, 投資するing.
Page has been 実験(する)d for 同意/服従 with INDUSTRY (not MS-only) 基準s, using the 解放する/自由な, 公然と accessible validator at validator.w3.org. Mostly passes.
Why does this page 原因(となる) a script to run? Because of the Google パネル盤s, and the code for the search button. Also, I have my web-traffic 監視するd for me by eXTReMe tracker. They 申し込む/申し出 a 解放する/自由な tracker. If you want to try one, check out their 場所/位置. Why do I について言及する the script? Be sure you know all you need to about spyware.
. . . . . P a g e . . . E n d s . . . . .