New stoker-web


 
Interfacing with a non-stoker device is something I have given thought to. I started writing this specifically for the stoker, so many of may model objects have the stoker nomenclatures but these concepts are pretty much the same for all monitoring devices. After working on it for a few weeks, I started to consider the possibility of stoker-web working with other devices so I had separated out the telnet and the Configuration controllers, these are the parts that retrieve the data and configurations from the stoker, so it may be possible to plug a new class in there to get data from wherever, a device or maybe even a file.

The tricky part comes in the configuration. The stoker assigns a unique ID to the probes and I use these IDs internally in maps to match up data and config items. The replacement config class would have to make up a configuration for the home brew and assigning IDs and roles to the probes ( ie. pit, blowers and monitor probes ).

My notifications are in their infancy, I can currently only notify based on high/low rules. I do have plans to have a notification that will alert if the temp rises or falls to sharply. This can can probably be expanded to notify if the temp is not changing x degrees in y minutes.

The original plan was to have a dynamic class loader that would load notification classes and feed them the temp and config data. This way any type of class could be written to monitor in any way that one saw fit; however, I steered away from this in the first set of releases because of the complexities of producing dialog windows to setup these custom alert types. This is advanced 'nice to have' stuff that can be considered down the road.

The code is all open source and you're free to take a look to see if/how you can change it to work for your home brew.
 
Gary,
This is giving me a little grief as well.

When I try to log on I get the following error in the browser...

Stoker not connected!

From what I can tell the program is not trying to access the Stoker.

Is it necessary to have the stoker on Port 23? For some reason I can't get port 23 to work on my network. Also, is the program looking for a specific stokerweb_log_file and does it have to be in a specific location?

Thanks
 
Hey Joe,

The best test you can do for connectivity is to attempt to telnet to the Stoker from a command prompt.

c:\> telnet <stoker IP> 23

You should get a login prompt.

If you can't connect you'll need to check your local firewall if you have one. If you're still stuck, you may have to explain your network setup so I can get a better picture of what might be causing your problems. Port 23 is the default for telnet, and it can be changed, but increases the complexity of the setup on the stoker end. I'd recommend you try to make it work on 23 first.

Stoker-web requires an external directory to store the configurations and the logs. This directory can be setup anywhere and named anything so long as the environment variable STOKERWEB_DIR be the absolute location of the directory (full path).

c:\> mkdir StokerWebDir
c:\> set STOKERWEB_DIR=c:\StokerWebDir

Feel free to email if you need help.
 
I'm able to telnet into the Stoker just fine.
My settings
Following is what I get when I try to logon...



c:\jetty-6.1.23>set STOKERWEB_DIR=c:\StokerWebDir

c:\jetty-6.1.23>java -jar start.jar
2011-11-07 20:25:13.741:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
2011-11-07 20:25:13.883:INFO::jetty-6.1.23
2011-11-07 20:25:13.925:INFO:
icon_biggrin.gif
eploy C:\jetty-6.1.23\contexts\javadoc.xml -> org
.mortbay.jetty.handler.ContextHandler@23d256fa{/javadoc,file:/C:/jetty-6.1.23/ja
vadoc/}
2011-11-07 20:25:13.987:INFO:
icon_biggrin.gif
eploy C:\jetty-6.1.23\contexts\test-jndi.xml -> o
rg.mortbay.jetty.webapp.WebAppContext@2e958bb8{/test-jndi,C:\jetty-6.1.23/contex
ts/test-jndi.d}
2011-11-07 20:25:13.994:INFO:
icon_biggrin.gif
eploy C:\jetty-6.1.23\contexts\stokerweb.xml -> o
rg.mortbay.jetty.webapp.WebAppContext@16290fbc{/stokerweb,C:\jetty-6.1.23/webapp
s/stokerweb.war}
2011-11-07 20:25:14.009:INFO:
icon_biggrin.gif
eploy C:\jetty-6.1.23\contexts\test.xml -> org.mo
rtbay.jetty.webapp.WebAppContext@1ed0af9b{/,C:\jetty-6.1.23/webapps/test}
2011-11-07 20:25:14.102:INFO::No Transaction manager found - if your webapp requ
ires one, please configure one.
2011-11-07 20:25:14.670:INFO:/stokerweb:Creating Jetty6 async servlet handler fo
r server jetty/6.1.23
StokerTelnetController:start() run()
StokerTelnetController:start() run() - calling startHelper()
StokerTelnet .start()
Creating Telnet connection.
Using StokerWebDir = [c:\StokerWebDir]
2011-11-07 20:25:15.045:INFO:/:Transparent AsyncProxyServlet @ /google to http:/
/www.google.com
2011-11-07 20:25:15.087:WARN::Unknown realm: Test JAAS Realm
log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.Sin
gleClientConnManager).
log4j:WARN Please initialize the log4j system properly.
2011-11-07 20:25:15.222:INFO::Opened C:\jetty-6.1.23\logs\2011_11_08.request.log

tInvalid Data Point: [Welcome to slush. (Version 1.16)
]
2011-11-07 20:25:15.259:INFO::Started SelectChannelConnector@0.0.0.0:8080
Response: {"ResultSet":{"version":"1.0","Error":0,"ErrorMessage":"No error","Loc
ale":"us_US","Quality":60,"Found":1,"Results":[{"quality":60,"latitude":"40.4182
30","longitude":"-80.048809","offsetlat":"40.418228","offsetlon":"-80.053230","r
adius":5200,"name":"","line1":"","line2":"Pittsburgh, PA 15220","line3":"","lin
e4":"United States","house":"","street":"","xstreet":"","unittype":"","unit":"",
"postal":"15220","neighborhood":"","city":"Pittsburgh","county":"Allegheny Count
y","state":"Pennsylvania","country":"United States","countrycode":"US","statecod
e":"PA","countycode":"","uzip":"15220","hash":"","woeid":12763661,"woetype":11}]
}}

Result String: [{"ResultSet":{"version":"1.0","Error":0,"ErrorMessage":"No error
","Locale":"us_US","Quality":60,"Found":1,"Results":[{"quality":60,"latitude":"4
0.418230","longitude":"-80.048809","offsetlat":"40.418228","offsetlon":"-80.0532
30","radius":5200,"name":"","line1":"","line2":"Pittsburgh, PA 15220","line3":"
","line4":"United States","house":"","street":"","xstreet":"","unittype":"","uni
t":"","postal":"15220","neighborhood":"","city":"Pittsburgh","county":"Allegheny
County","state":"Pennsylvania","country":"United States","countrycode":"US","st
atecode":"PA","countycode":"","uzip":"15220","hash":"","woeid":12763661,"woetype
":11}]}}
]
found login string
Sent: [root
]
woeid: 12763661
Response: {"units":{"temperature":"F","speed":"mph","distance":"mi","pressure":"
in"},"location":{"location_id":"USPA0237","city":"Carnegie","state_abbreviation"
:"PA","country_abbreviation":"US","elevation":797,"latitude":40.41000000000000,"
longitude":-80.08000000000000},"wind":{"speed":0.00000000000000,"direction":"CAL
M"},"atmosphere":{"humidity":"53","visibility":"10","pressure":"30.28","rising":
"steady"},"url":"http:\/\/weather.yahoo.com\/forecast\/USPA0237.html","logo":"ht
tp:\/\/l.yimg.com\/a\/i\/us\/nt\/ma\/ma_nws-we_1.gif","astronomy":{"sunrise":"06
:57","sunset":"17:11"},"condition":{"text":"Fair","code":"33","image":"http:\/\/
l.yimg.com\/a\/i\/us\/we\/52\/33.gif","temperature":56.00000000000000},"forecast
":[{"day":"Today","condition":"Mostly Clear","high_temperature":"64","low_temper
ature":"37"},{"day":"Tomorrow","condition":"Mostly Sunny","high_temperature":"68
","low_temperature":"43"}]}

weather: {"units":{"temperature":"F","speed":"mph","distance":"mi","pressure":"i
n"},"location":{"location_id":"USPA0237","city":"Carnegie","state_abbreviation":
"PA","country_abbreviation":"US","elevation":797,"latitude":40.41000000000000,"l
ongitude":-80.08000000000000},"wind":{"speed":0.00000000000000,"direction":"CALM
"},"atmosphere":{"humidity":"53","visibility":"10","pressure":"30.28","rising":"
steady"},"url":"http:\/\/weather.yahoo.com\/forecast\/USPA0237.html","logo":"htt
p:\/\/l.yimg.com\/a\/i\/us\/nt\/ma\/ma_nws-we_1.gif","astronomy":{"sunrise":"06:
57","sunset":"17:11"},"condition":{"text":"Fair","code":"33","image":"http:\/\/l
.yimg.com\/a\/i\/us\/we\/52\/33.gif","temperature":56.00000000000000},"forecast"
:[{"day":"Today","condition":"Mostly Clear","high_temperature":"64","low_tempera
ture":"37"},{"day":"Tomorrow","condition":"Mostly Sunny","high_temperature":"68"
,"low_temperature":"43"}]}

found password string
Sent: [tini
]
Http Session Created
Creating new listener.


stokerweb.properties (note I changed the serial to the serial for my pit)

# Stoker settings, you should only have to set the IP address
stoker_ip=192.168.1.6
stoker_port=23
stoker_login=root
stoker_pass=tini

stokerweb_logs_dir=stokerweblogs

# Temps are written to the log file every x milliseconds (60,000) = 60 seconds.
stokerweb_log_file_period=60000

# Associate the Serial ID of each pit probe to a Cooker Name
EF0000116F04FC30=Cooker

# Mail settings
mail.sendTo=xxx@gmail.com
mail.password=nonegiven
mail.smtp.user=email.account
mail.smtp.host=smtp.gmail.com
mail.smtp.port=465
mail.smtp.starttls.enable=true
mail.smtp.debug=true
mail.smtp.auth=true
mail.smtp.socketFactory.port=465
mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback=false

# Your local zip code to pull weather information.
weather_zipcode=15220

# These should not change, it is important that there are no spaces after the trailing '='
weather_woeid_url=http://where.yahooapis.com/geocode?country=USA&flags=J&postal=
weather_get_by_woeid_url=http://weather.yahooapis.com/forecastjson?w=



edit:

After a few minutes the following comes up at the command prompt...

2011-11-07 20:44:04.706:WARN:/:Error sending heartbeat
org.mortbay.jetty.EofException
at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:789)
at org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGenerator.ja
va:568)
at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java:100
6)
at net.zschech.gwt.comet.server.deflate.DeflaterOutputStream.flush(Defla
terOutputStream.java:100)
at net.zschech.gwt.comet.server.impl.CountOutputStream.flush(CountOutput
Stream.java:64)
at sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
at sun.nio.cs.StreamEncoder.flush(Unknown Source)
at java.io_OutputStreamWriter.flush(Unknown Source)
at net.zschech.gwt.comet.server.impl.CometServletResponseImpl.flush(Come
tServletResponseImpl.java:366)
at net.zschech.gwt.comet.server.impl.CometServletResponseImpl.heartbeat(
CometServletResponseImpl.java:345)
at net.zschech.gwt.comet.server.impl.ManagedStreamCometServletResponseIm
pl.heartbeat(ManagedStreamCometServletResponseImpl.java:100)
at net.zschech.gwt.comet.server.impl.BlockingAsyncServlet.suspend(Blocki
ngAsyncServlet.java:92)
at net.zschech.gwt.comet.server.impl.CometServletResponseImpl.suspend(Co
metServletResponseImpl.java:269)
at net.zschech.gwt.comet.server.CometServlet.doCometImpl(CometServlet.ja
va:157)
at net.zschech.gwt.comet.server.CometServlet.doGet(CometServlet.java:108
)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511
)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:3
90)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.jav
a:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:1
82)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7
65)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)

at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand
lerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.
java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1
52)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:54
2)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpCo
nnection.java:924)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
va:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.j
ava:582)
Http Session Created



One last question...

Could this be related to the Stoker Firmware?

I'm on Version 2.7.0.207
 
Could this be related to the Stoker Firmware?

I'm on Version 2.7.0.207

I's possible since I am testing on 2.6.0.254, but I don't see anything in the release notes that would lead to a change to the telnet or http output.

The output you posted looks normal but is missing some crucial sections. After sending the password, stokerweb is looking for the tini prompt, it it looks like it is failing to find that and does not continue.

<pre class="ip-ubbcode-code-pre">
found password string
Sent: [tini^M
]
found tini prompt
sendTempsCommand()
Sent: [
bbq -temps
]
found tini prompt
found tini prompt
tInvalid Data Point: [tini126134 /> tini126134 /> tini126134 /> E70000116F279030: 2 24.4 75.9 40.6 1 1 2 51.2 124.1 PID: NORM tgt:15.5 error:-178.2 drive:-4.3 istate:-15 off due to overshoot blwr:eek:ff
]
tpwaitForTemps(): Found TEMPS
</pre>

Could you login via telnet, issue the 'bbq -temps' command and capture the output of the entire telnet session? I'm wondering if the output that I'm expecting has changed.

Thanks
 
Output is as follows...


Welcome to slush. (Version 1.16)


tini048af6 login: root
tini048af6 password:
tini048af6 /> bbq -temps
tini048af6 /> EF0000116F04FC30: 2.0 19.1 66.4 -4.4 -0.1 0.8 0.6 18.4 65.1
EF0000116F04FC30: 2.0 19.1 66.4 -5.0 -0.1 0.8 0.6 18.0 64.4
EF0000116F04FC30: 2.0 19.1 66.4 -4.4 -0.1 0.8 0.6 18.4 65.1
EF0000116F04FC30: 2.0 19.1 66.4 -4.4 -0.1 0.8 0.6 18.4 65.1
EF0000116F04FC30: 2.0 19.1 66.4 -4.4 -0.1 0.8 0.6 18.4 65.1
EF0000116F04FC30: 2.0 19.1 66.4 -4.4 -0.1 0.8 0.6 18.4 65.1
EF0000116F04FC30: 2.0 19.0 66.2 -4.4 -0.1 0.8 0.6 18.3 64.9
EF0000116F04FC30: 2.0 19.1 66.4 -4.4 -0.1 0.8 0.6 18.4 65.1
EF0000116F04FC30: 2.0 19.1 66.4 -4.4 -0.1 0.8 0.6 18.4 65.1
EF0000116F04FC30: 2.0 19.1 66.4 -4.4 -0.1 0.8 0.6 18.4 65.1
EF0000116F04FC30: 2.0 19.1 66.4 -4.4 -0.1 0.8 0.6 18.4 65.1
...............

Gary,

A quick follow up,

After telneting to the Stoker I now get a web page. However, no Stoker information shows up. I see the main page less the graphs and gauges.

On the bright side, I'm getting closer.

I'm going to try downgrading the FW and see if that changes anything.

Thanks
 
I see. The tini prompt is not consistent between stokers. I'll have to make a change this evening and produce a new war file.

Thanks
 
Thanks Gary.

Current FW works the same as the older version. It takes quite a while but the gauges do appear. The area for the graph is still blank though, I'm not sure what I'm missing there.
 
Originally posted by Gary Bak:
Do the gauges have correct temp data?

and do you see repeated tptptptp messages on the console?

gauges report correct temperature and yes I see the repeated tptp..

stokerweb.jpg

A snippet from the command prompt...


found password string
Sent: [tini
]
tptptInvalid Data Point: [tini048af6 /> EF0000116F04FC30: 2.0 24.3 75.6 -8.8 -0.
2 1.0 0.8 20.8 69.5 PID: NORM tgt:20.0 error:-4.1 drive:-0.8 istate:-73.1 off du
e to overshoot blwr
icon_redface.gif
ff
]
tptptptptptptptptptptptptptptp
 
Ok, The missing Cooker name and the missing Default log name leads me to think that it did not detect the pit probe ID in the stoker.properties file. Try to change your alpha characters in the ID, that is in your stoker.properties file, to lower case. If that works, I can make a code change to ignore the case.

Thanks
 
I was just able to reproduce your condition by changing one fo the characters in the pit ID to uppercase. Changing all the characters to lower case should fix your problem.

Since this value is a key in the lookup of the cooker name, it's not so easy to detect an incorrect case in the name. Until I think of a good solution, I'll require that the pid ID be in lower case.
 
Gary,

changed association as follows...

# Associate the Serial ID of each pit probe to a Cooker Name
ef0000116f04fc30=Big Betty

Seems to have helped but still no graph..

Untitled.jpg



I tried creating a new log but it doesn't seem to help.
Sorry to keep bothering you.
 
What browser is that, and can you try another?

If you tried creating a new log, check the server logs directory to see if a new file was created for you. There should be one with the current date and log name appended to it

Thanks
 
I've tried Firefox, Chrome and IE 9 and have the same issue with all.

Do you think I could be doing something wrong?

I only need to associate the pit probe, not the blower or temp probe correct?

Could it be a windows 7 issue?

I have extensions on ff and chrome but not ie so I don't think it could be an extension issue.

below is my stokerweb.properties file

# Stoker settings, you should only have to set the IP address
stoker_ip=192.168.1.6
stoker_port=23
stoker_login=root
stoker_pass=tini

stokerweb_logs_dir=stokerweblogs

# Temps are written to the log file every x milliseconds (60,000) = 60 seconds.
stokerweb_log_file_period=60000

# Associate the Serial ID of each pit probe to a Cooker Name
ef0000116f04fc30=big betty


# Mail settings
mail.sendTo=xxx@gmail.com
mail.password=
mail.smtp.user=email.account
mail.smtp.host=smtp.gmail.com
mail.smtp.port=465
mail.smtp.starttls.enable=true
mail.smtp.debug=true
mail.smtp.auth=true
mail.smtp.socketFactory.port=465
mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback=false

# Your local zip code to pull weather information.
weather_zipcode=15220

# These should not change, it is important that there are no spaces after the trailing '='
weather_woeid_url=http://where.yahooapis.com/geocode?country=USA&flags=J&postal=
weather_get_by_woeid_url=http://weather.yahooapis.com/forecastjson?w=
 
Sorry Joe,

Try the Blower ID here instead of the Pit ID:

# Associate the Serial ID of each pit probe to a Cooker Name
ef0000116f04fc30=big betty
 
Success!!!

Lessons learned...

- In my case, I must telnet into the Stoker and run bbq -temps prior to starting jetty.

- I must Associate the Serial ID of the blower to a Cooker Name

Can I set names for all of the probes and fan so I can eliminate the display of serial numbers?

Thanks a million!
 
Yes, you will need to start the temp output by hand with bbq -temps. I have made the fix already, but it's not checked in. I may check it in tonight and create an alpha2 war file.

I'll update the documentation to specify the blower ID and not the Pit ID.

The names can be updated from the stokers internal web page. You can change the name from within stoker-web, but I don't know if I persist that yet.

Thanks for trying it out and the feedback.
 
I just packaged and updated the alpha 2 release.

It contains:
* Fix to problem were stoker-web was not detecting login condition because of tini prompt differences.
* Browser and email alerts
* Updates css and formatting

The Alerts work, but not as full-featured as I'd like.
The Alert will fire over and over every 1 minute until the condition is gone. This 1 minute period will be configurable in the next release. I'd also plan to make the browser alarm sound configurable and the popup alert message needs formatting.

Android is still not working, haven't really looked into it yet. I may create a light weight page for mobile browsers, since I don't really care to see the graph on the phone.

Give this a try and send any feedback you may have.

Thanks
 

 

Back
Top