Arduino & Autobahn

#1

I have successfully implemented the serial2ws.py and the arduino code attached with it.

To be very frank enough I am not an expert in Python and Autobahn and just copied the code as it is.

Now , I wanted to implement that with the following code of Arduino , a ping sensor attached to Pin7 of Arduino. The code of the same is given below

const int pingPin = 7;

void setup() {
// initialize serial communication:
Serial.begin(9600);
}

void loop()
{
CODE IN BETWEEN

Serial.print(inches);
Serial.print(’\t’);
Serial.print(cm);
Serial.println();

delay(100);
}

I am getting the values of distance in the console. But in http://localhost:8080/index.html no values are coming although the led on/off buttons are working.

Can anyone please help me where to modify the index.html file so that I can the values constantly.

0 Likes

#2

SOLVED

···

On Wednesday, July 17, 2013 9:50:09 AM UTC+5:30, en…@cleantechsolution.in wrote:

I have successfully implemented the serial2ws.py and the arduino code attached with it.

To be very frank enough I am not an expert in Python and Autobahn and just copied the code as it is.

Now , I wanted to implement that with the following code of Arduino , a ping sensor attached to Pin7 of Arduino. The code of the same is given below

const int pingPin = 7;

void setup() {
// initialize serial communication:
Serial.begin(9600);
}

void loop()
{
CODE IN BETWEEN

Serial.print(inches);
Serial.print(’\t’);
Serial.print(cm);
Serial.println();

delay(100);
}

I am getting the values of distance in the console. But in http://localhost:8080/index.html no values are coming although the led on/off buttons are working.

Can anyone please help me where to modify the index.html file so that I can the values constantly.

0 Likes

#3

Please share how you solved :slight_smile:

···

On Jul 17, 2013 7:34 AM, en...@cleantechsolution.in wrote:

SOLVED

On Wednesday, July 17, 2013 9:50:09 AM UTC+5:30, en…@cleantechsolution.in wrote:

I have successfully implemented the serial2ws.py and the arduino code attached with it.

To be very frank enough I am not an expert in Python and Autobahn and just copied the code as it is.

Now , I wanted to implement that with the following code of Arduino , a ping sensor attached to Pin7 of Arduino. The code of the same is given below

const int pingPin = 7;

void setup() {
// initialize serial communication:
Serial.begin(9600);
}

void loop()
{
CODE IN BETWEEN

Serial.print(inches);

Serial.print(’\t’);
Serial.print(cm);
Serial.println();

delay(100);
}

I am getting the values of distance in the console. But in http://localhost:8080/index.html no values are coming although the led on/off buttons are working.

Can anyone please help me where to modify the index.html file so that I can the values constantly.

You received this message because you are subscribed to the Google Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

0 Likes

#4

Dear Marc

There is only one portion where I modified

function onAnalogValue(topicUri, event) {
eventCnt += 1;
//event.value = event.value / 400 * 100;
analog0.innerHTML = event.value;
analog0_last = event.value;
line0.append(new Date().getTime(), event.value);
analog1.innerHTML = event.id;
analog1_last = event.id;
line1.append(new Date().getTime(), event.id);
}

This gave me the result.

···

On Thursday, July 18, 2013 4:19:52 AM UTC+5:30, mark hubrich wrote:

Please share how you solved :slight_smile:

On Jul 17, 2013 7:34 AM, en...@cleantechsolution.in wrote:

SOLVED

On Wednesday, July 17, 2013 9:50:09 AM UTC+5:30, en…@cleantechsolution.in wrote:

I have successfully implemented the serial2ws.py and the arduino code attached with it.

To be very frank enough I am not an expert in Python and Autobahn and just copied the code as it is.

Now , I wanted to implement that with the following code of Arduino , a ping sensor attached to Pin7 of Arduino. The code of the same is given below

const int pingPin = 7;

void setup() {
// initialize serial communication:
Serial.begin(9600);
}

void loop()
{
CODE IN BETWEEN

Serial.print(inches);

Serial.print(’\t’);
Serial.print(cm);
Serial.println();

delay(100);
}

I am getting the values of distance in the console. But in http://localhost:8080/index.html no values are coming although the led on/off buttons are working.

Can anyone please help me where to modify the index.html file so that I can the values constantly.

You received this message because you are subscribed to the Google Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

0 Likes

#5

Sorry for late response .. I am drowning in stuff to do;(

Great that it works for you now .. Python is simple to learn!

/Tobias

···

Am 18.07.2013 03:46, schrieb en...@cleantechsolution.in:

Dear Marc
There is only one portion where I modified
function onAnalogValue(topicUri, event) {
             eventCnt += 1;
             //event.value = event.value / 400 * 100;
               analog0.innerHTML = event.value;
               analog0_last = event.value;
               line0.append(new Date().getTime(), event.value);
               analog1.innerHTML = event.id;
               analog1_last = event.id;
               line1.append(new Date().getTime(), event.id);
             }
This gave me the result.

On Thursday, July 18, 2013 4:19:52 AM UTC+5:30, mark hubrich wrote:

    Please share how you solved :slight_smile:

    On Jul 17, 2013 7:34 AM, <en...@cleantechsolution.in <javascript:>> > wrote:

        SOLVED

        On Wednesday, July 17, 2013 9:50:09 AM UTC+5:30, > en...@cleantechsolution.in wrote:

            I have successfully implemented the serial2ws.py and the
            arduino code attached with it.
            To be very frank enough I am not an expert in Python and
            Autobahn and just copied the code as it is.
            Now , I wanted to implement that with the following code of
            Arduino , a ping sensor attached to Pin7 of Arduino. The
            code of the same is given below
            const int pingPin = 7;
            void setup() {
               // initialize serial communication:
               Serial.begin(9600);
            }
            void loop()
            {
               CODE IN BETWEEN

               Serial.print(inches);
               Serial.print('\t');
               Serial.print(cm);
               Serial.println();

               delay(100);
            }
            I am getting the values of distance in the console. But in
            http://localhost:8080/index.__html
            <http://localhost:8080/index.html> no values are coming
            although the led on/off buttons are working.
            Can anyone please help me where to modify the index.html
            file so that I can the values constantly.

        --
        You received this message because you are subscribed to the
        Google Groups "Autobahn" group.
        To unsubscribe from this group and stop receiving emails from
        it, send an email to autobah...@googlegroups.com <javascript:>.
        For more options, visit https://groups.google.com/groups/opt_out
        <https://groups.google.com/groups/opt_out>.

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes