- Thu Aug 04, 2016 10:36 pm
#52165
There really has not been much that changed and the editor in most cases will tell you what is wrong with your code via error messages.
https://docs.google.com/document/d/1EiY ... YyJon8/pubThis is the documentation above for all 3.x code
Here is message branch:
https://docs.google.com/document/d/1EiY ... 6ep3w7frt5Here is wget:
https://docs.google.com/document/d/1EiY ... 4g8o5xev7cIf you look at the following code we can equate a few things and get familiar with it.
Code: Select allprint "Server is waiting for requests."
msgbranch [mybranch]
wait
[mybranch]
pinno = val(msgget("pin"))
pinstatus = val(msgget("stat"))
pinaction = msgget("action")
if pinaction == "po" then gosub [pomypin]
msgreturn myreturnmsg
wait
[pomypin]
io(po,pinno,pinstatus)
myreturnmsg = "Request Recieved"
return
Let us imagine for one second that our IP of the ESP we are working with is 192.168.1.1 !
With the following code above if we wanted to turn pin 2 on we can do it really easily.
We log on to any computer on the same network or tablet or phone or whatever and simply open the web browser and request it like so:
http://192.168.1.12/msg?pin=2&stat=1&action=poTo turn it off it would be just changing the stat from a 1 to a 0
http://192.168.1.12/msg?pin=2&stat=0&action=poIf you would prefer to turn on pin 4 instead just change the pin value to 4 like so
http://192.168.1.12/msg?pin=4&stat=1&action=poAnd off for pin 4 would be
http://192.168.1.12/msg?pin=4&stat=0&action=poNow if we wanted we could add multiple actions with if statements which opens the door to a multituide of subs we could execute lets imagine we would want to execute action xxx we would open our browser and request it as follows:
http://192.168.1.12/msg?action=xxxThe main take away here is we can pick out whatever we wish to read from a url simply put using msgget and we can craft it to preform any action...
We can even make a request to another device that has msgbranch enabled on it using wget to run code on our other device.
You see it is not that difficult really msgbranch is a very powerful tool it is a solution that is better than all of these services that are out there to send messages to a device to preform tasks because you can customize its function to whatever your heart desires and it requires no third party to operate!
Enjoy hope this may aid you a little in your journey.
PS I am not no guru of code either about a few months messing around with this stuff honestly but that is the beauty of basic its well.... BASIC. There is so much though that I have yet to even attempt I have a laundry list of things I would like to do long term but right now my goals are realistic poke away at things a little at a time get to know and understand them heck I haven't even touched udp so you have one up on me.
@ electrogaurd
Yes, I carefully consider all opinions even your own. This last one has led me to believe that you may need to seek help for your condition though whatever it is that is the real underlying issue I hope you get down to the bottom of it and learn to forgive yourself or someone else to harbor all of this hate is not healthy for anyone to be honest.
I sincerely wish you the best you are welcome though to share your opinions any time even if I don't like them I suppose at first I was a bit startled and posted something that looked a bit like your post and I figured no its best not to do so maybe I should take it in stride and try to listen to what it is you have to say then I read more and I really don't think anything I say could help make your life better as I am not a professional shrink either.
But I really do appreciate your work and most of what you have to say as well. Maybe some day you will learn not to mistake my joining in on a discussion as something to undermine your authority it is nothing more then sharing in the conversation I'm sorry in your mind that you think that someone with less knowledge in a certain area should not speak at all. But I believe this is unhealthy this is a forum made for discussions for all levels I hope you are aware I do not suffer from much other than your attacks to be honest but they are forgiven and I will continue to do so.
I welcome all of your speech because this is an important freedom and we should never lose sight of what a forum built on discussion is about this very thing. There is an error in your thinking as well what your ideals would bring is zero discussion on this forum because people would live in fear that they would be attacked from people like yourself for saying anything. I will not be one of those people nor will I promote such an agenda. But I will allow you to continue on freely to errr is human I believe. Ego does get the best of all of us at time it is important to reflect on what you say and the society you would like to see as it all starts with you and what you say is a contribution to building that very thing.
You are welcome to any one of my posts and to be rather frank you can even chime in and scrutinize if that is what makes you feel better whatever it is that is going to help you feel better about you. I assure you this is all not about me I personally love discussion you obviously do not when it comes to social skills I believe you mentioned I was lacking them but at the same time you don't want anyone without a genius IQ to talk a bit ironic but again I will consider this maybe it is me who does not have the correct social skills.
To be rather honest I would like to see more discussion from everybody on the basic forums I do not want the same silence as you I like to see feedback I like to see comments I like to see discussion from people of all IQ levels or no matter where they are at a specific time.
You did a great job with driving lessons excellent post.
I just really wish you would chime in and discuss more then I may not feel the need to chime in and help out the best I can this is not done for fame or to make myself look good as you say heck I am just trying to repay a favor that was given to me I've said this many times mmiscool gave me a hand with learning some of this stuff and I'm just kind of passing it along. Trying to build a community based on discussion from anyone who wants to talk basic.
Maybe this is wrong but again I have nothing to prove here electrogaurd if I was trying to build anything in that manner I would likely use my name and a facebook account however this is not the case. I wish you the best in your journey as well sad thing that you really feel this way but I am not going to try to change your mind I've learned a hard lesson years ago I have met a couple of people in my entire life other than you maybe about five out of the countless I have met who share your views I couldn't tell them the error in their ways and I likely am wasting my time typing here as well.
But just think for one moment what type of society are you building when you would like to limit peoples ability to discuss things on an open discussion? How likely is it that someone will post without fear of being attacked by your comments after reading something like this people will be less likely to contribute!
This is what you are bringing to the table with your actions. While you may not like what I have to say I ask that you be an adult and reflect on these things as well.
I would like to see more discussions and more posts answered by yourself I would like to see you put time and energy into doing it more your way really I would this would be great I don't know how much more clear I could be when I say I want to see more discussions. I see posts where there are hundreds of views good posts and some of those posts looking for feedback as well and no one says a word and it is partially due to people like yourself promoting this you should shut up if you don't know type of agenda I just beg to differ and again agree to disagree I suppose but you are welcome to continue on this issue.
But lets clarify a few things once and for all.
No I am not chiming in for any nefarious reason or to be special or have the last comment none of these things really matter to me it is the discussion, the community, the learning, the teaching, and espbasic in general I actually enjoy this go figure a guy wants to discuss something he enjoys how terrible! I know I know.
And I am
NOT the all knowing all seeing overlord with a genius IQ sorry just did not turn out that way at least I don't think so never did test myself but I would bet I'm pretty average maybe a bit above I really cannot say for sure.
As far as social skills you define them a bit differently than me the ability to socialize with people of all different IQ's, ideas, amount of talk off topic and on to me those are social skills. Socializing requires acceptance of both things you like and topics that may not be your favorite. The minute you need to start attacking someone for contributing to the conversation you introduce antisocial tendencies. Open up your mind a bit think a little beyond you. I am different I am not you nor do I want to become like you in a social aspect I am more accepting and open and as I said your comments have been dead for a long time I am interested to see what you have to say on every topic really I'd love it if you chimed in more and got the last word it would actually be a boost and a help to the community I'd guess as long as you did not insult people it would be healthy and heck maybe even if you did I really don't care I guess I'd like to see you share more of all of that knowledge you are not no dummy chime in help more folks out obviously not all of my answers are eloborate as they could be I would be grateful if you were to best every one of my comments or share your opinion even if it is defaming me and mine as long as at the end of the day it was something productive!!!