First steps in Italian language, is it possible?

Hi all,

some days I have a imp001 and a April Development Board… my English is not good and it is difficult for me to understand how to best use this amazing device … is there anyone among you who is willing to help me make the first steps using the Italian language? :-S

Thanks.

I can’t help… have you tried google translate?

Hi Hugo,

thanks for your reply…

The problem is not reading or writing, but in being able to expound the concepts that are often “behind” to precise terms… this is the real difficulty for beginners like me… :frowning:

Hi Maxim,

If there are any particular concepts you are struggling with feel free to post them here on the forum, we’re a friendly community and may be able to help

thanks back_ache,

this is my problem:

a friend of mine wants to use imp001 with a temperature sensor (TMP36) and view the data collected on its website written entirely in classic ASP… it is possible to do? is possible to have a small example? :-/

Thanks in advance to all for your assistance and patience… :wink:

P.S. my nikname is maXim, not Maxim! (uppercase “X” only) :">

Classic ASP should not be an issue at all, imp presents itself in a very standard way that their will be many example on on the internet of how to do.

Let me know if you have any issues finding some code and I’ll find some for you.

thanks back_ache for your assistance,

in truth I have not had any problems in implementing the procedures for the Device but can not figure out how to go about the Agent, and then how to interface this to the ASP page…

maXim… We have the Nora reference design available which is an environmental sensor node that includes temperature, light level, pressure, humidity, and an accelerometer if you are interesting in buying something that is ready to go. It uses the Imp002 module.

Thanks MakeDeck but our intent is to make a new experience to learn something that is useful in our hobbies and to “modernize” our old “toys”… (a imp001 and a April breakout board are more than enough)… :wink:

OKay, step one, forget about “Classic ASP” (for now)

Instead use the existing April examples to create something that with a browser you can send a query string and get a response.

Once you have that working I can help you get it talking “classic asp”

There are some classic asp examples on consuming a service in the following link

Hi back_ache,

as I already mentioned to you in previous posts, I have not encountered any problem in making the procedure for the device but can not understand how to proceed to the Agent… I read in the forum the examples for Agent but really can not understand conceptually how do I do this and why do I have to do it!.. however, I propose the following simplified procedure for the Device (the procedure works and readings are displayed correctly in the Device Logs window):

// configure the pins: hardware.pin9.configure(ANALOG_IN); // sets the pin 9 as analog input

function getTEMPERATURE()
{

// initialize local variables:
local v = 0.0; // voltage value from temperature sensor (TMP36)
local r = null; // conversion ratio value between volts and the resolution of the temperature sensor
local tC = null; // temperature value in degrees Celsius (°C)
local tFMT = null; // formatted temperature value

v = hardware.pin9.read(); // gets the raw voltage value from temperature sensor

r = 65520.0 / v; // sets the conversion ratio

tC = ((3300 / r) - 500) / 10.0; // calculates the temperature in degrees Celsius

tFMT = format(“%.1f”, tC); // formatting the temperature value with one decimal

server.log(tFMT + “°C”); // show the temperature in Device Logs window

imp.wakeup(5.0, getTEMPERATURE); // wait for 5 seconds before a new reading…

}

getTEMPERATURE();


… and now, how should I proceed? :-/

Next step is to get your get temperature function to return a value and have it called from an agent.on function.

Hi back_ache,

as I wrote in my previous post, this is exactly what I do not understand! If the value is already accessible from the Device Logs, because I have to do the procedure for Agent? And then how it should be done this procedure to Agent? An example? :-S

@maXim, the agent doesn’t read the logs. That is not its job. If you want the agent to process the data you are showing in the log - the temperature - then you need to send that data to the agent separately by sending it a message plus the data.

This Developer Guide will help you:

https://translate.google.com/translate?sl=en&tl=it&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Felectricimp.com%2Fdocs%2Fresources%2Finteractive%2F&edit-text=

@smittytone, thanks for your support but I still do not understand! If the Agent does not read the logs, then how do I retrieve the temperature from a simple HTML page located on any website?

I visited the Developer Guide link, but the result is that I have even more confusion in my mind… :frowning:

… start again from the beginning, please… =;

Let’s see if anyone can help me with this simple example:

Device code:

`local i = 0; // initializes the variable
function MyTest()
{
i++; // increments of one unit
server.log(i); // show the increment in Device Logs
imp.wakeup(5.0, MyTest); // wait for 5 seconds before a new increment…
}

MyTest();`
… what should I do to display the counter on an HTML page? :-/

You need to send the value of i to the agent, which will store the current value in a variable. So instead of server.log(i) use agent.send(“current.temp”, i)

You now get your agent to save this temperature:

function save_temp(temperature_from_imp) { current_temperature = temperature_from_imp }

and

current_temperature <- 0 device.on("current.temp", save_temp)

The device.on() tine tells the agent to watch for the incoming temperature message “current.temp” and to call the function save_temp() when it receives this message.

Now set up the agent with an http handler function (see this guide: electricimp.com/docs/gettingstarted/3-agents/

The http handler detects the request from the browser (“getvalue”) and sends back the current temperature value:

`function request_handler(request, response)
{
try
{
// Check for app test

    if ("getvalue" in request.query)
    {
        response.send(200, current_temperature.tostring)
        return
    }
}
catch(ex)
{
    response.send(500, ("Agent error: " + ex))
}

}`

and

http.onrequest(request_handler)

Next, you need to get your web page to send a request to your agent URL (displayed at the top of the agent code in the IDE, eg. https://agent.electricimp.com/12345678abcde) for the current value:

https://agent.electricimp.com/12345678abcde?getvalue

You will need some suitable web code to get the response sent by the agent. You can put the line https://agent.electricimp.com/12345678abcde?getvalue in the address field of your browser, and the response from agent will appear on the page. But if you need something more interactive, you’ll need to write or obtain JavaScript code to send the temperature request to the agent (as above) and display the response.

and at it’s simplest the classic ASP would be

`

<%
Set objXML = Server.CreateObject(“MSXML2.ServerXMLHTTP”)
objXML.Open “GET”, “https://agent.electricimp.com/12345678abcde?getvalue”, false
objXML.Send("")
Response.Write objXML.responseText
%>

`