Show Posts
Pages: [1] 2 3 ... 7
1  Using Arduino / Programming Questions / Re: Break/Stop loop with MQTT payload/message on: April 21, 2014, 10:34:54 am
Quote
Well, that's perfectly obvious. To you.
It is cause its the payload.
The topic says MQTT so this is about the Arduino pubsubclient.
Quote
But it sure doesn't have to have the meaningless name "callback".
It is not meaningless if you know MQTT in conjunction with Arduino cause it's part of
the pubsubclient (Arduino client for MQTT).

And everything is working great. Switching house lights, TV  programs, Doorbell ring through Asterisk over VoIP
to Softphones, 1-Wire sensor logging to MariaDB....
I only can't get this stupid loop stop to work.

I do it with voice commands.
The idea was if i say "TV volume up" that the Arduino sends the IR signal until i say "volume stop".
Volume up works but i can't stop it.

The server sends payload "volume-up" to the Arduino and runs it and it's working.
But if i send then the payload "volume-stop" it does not stop running "volume-up".
If i check my "int test" after sending "volume-stop" it's set to "1" but does not effect the running  "volume-up" loop.
2  Using Arduino / Programming Questions / Re: Break/Stop loop with MQTT payload/message on: April 21, 2014, 05:40:24 am
@lar3ry, you don't know MQTT? Then for sure my code makes no sense to you.
MQTT = Message Queue Telemetry Transport: http://en.wikipedia.org/wiki/MQ_Telemetry_Transport

Callback is part of http://knolleary.net/arduino-client-for-mqtt/

So "volume-up" runs if my MQTT broker on my server sends: "/mytopic/mytopic/IR-SonyTV/volume-up"
And "test" gets changed if i call/send: "/mytopic/mytopic/IR-SonyTV/volume-stop"
3  Using Arduino / Programming Questions / Break/Stop loop with MQTT payload/message on: April 20, 2014, 07:39:59 pm
Hi,

after almost two days i give up.
I want to stop a loop with MQTT but can't get it to work.
I tried endless possibilities. Here is one:
Code:
int test = 0;
void callback(char* topic, byte* payload, unsigned int length) {

  if (length == 9 && strncmp((char*)payload,"volume-up",9)==0) {
    for (int i = 0; i < 1000; i++) {
      Serial.println("up");
      Serial.println(test);
      delay(50);
      if (test == 1) {
        break;
      }
    }
  }


  if (length == 11 && strncmp((char*)payload,"volume-stop",11)==0) {
    Serial.println("stop");
    Serial.println(test);
    test = 1;
  }

}
If i call "volume-up" and get my test prints and then call "volume-stop" nothing happens.
If i call "volume-stop" first and then again i see that "test" has a value of "1".
Also "volume-up" is then printed just once.

I also tried it in "void loop()" with:
Code:
while (test == 0) {
  Serial.println("its running");
  Serial.println(test);
  // delay(20);
  if (test == 1){
    break;
  }
}
But that also doesn't stop if i call "volume-stop".

I'm out off ideas smiley-sad
4  Using Arduino / Networking, Protocols, and Devices / Re: 1-Wire Vcc GND - connect to Data GND on sensors? on: April 02, 2014, 02:33:47 pm
beside the sensor
Then 1-Wire would not make sense smiley

I don't sum it up yet. But 15, 20,  30 meters is nothing in a house.
From living room to bed room 8m...
From bed room to bath room 8m...
To the sensor and back in the cement flooring is 4+4=8m
That alone makes 16 meters!
Then i go to the windows (each 2 reed switches and a glass breakage detector)...

I found one guy who uses the Loxone Smart Home Automation and has 1 ring
for each floor of his house. Every window, door, temp in every room and so on...
And Maxim writes about 100, 200, 500 meters - so it should not be a problem if you do it right.
But now i have S/FTP PiMF everywhere and its to late cause i thought its the best.
I use CAT6 for one wire and my light switches and CAT7 for Ethernet.

Quote
Try it in an environment as identical as possible to the final installation
How can somebody to that? How to replicate all the wires/electric in your house (walls, ceiling)?
Especially if you just start to build your house...

No Apple stuff in da house smiley-evil

I extra bought two books about EMC/EMI from VDE (http://en.wikipedia.org/wiki/Verband_der_Elektrotechnik,_Elektronik_und_Informationstechnik)
5  Using Arduino / Networking, Protocols, and Devices / Re: 1-Wire Vcc GND - connect to Data GND on sensors? on: April 02, 2014, 07:19:09 am
Quote
Cat 5/6 cables make sense if your devices are quite far away, they are a waste of material if the distance is less than half a meter in a not so noisy environment.
Looks like thats not really the case.
Dallas recommendation is UNSHIELDED CAT5 cable and to not use shielded cable as the capacitance increases.
You can read stuff like (from 1-Wire-Design Guide v1.0): For short runs (where the total length of the 1-Wire bus is < 30 meters and the network only has a few slave devices on it), cable selection for use on the MicroLAN is reasonably simple, as even flat modular phone cable can work with a small numbers of 1-Wire slave devices.
On the other hand you have people who have problems with just 20 meters and CAT5/6 where you can read in docs that
100 or 200 meters shouldn't be a problem.

Then you can read:
Grounding unused wires or shields in a cable adds capacitance, which can significantly increase the RC time constant, they should be left disconnected. You want to limit capacitance throughout a 1-wire system as much as possible to maximize cable length and limit RC effects. Dallas Semiconductor recommends that unused wires and shields be left unconnected at both ends of the cable. The wires should be left floating.
But then you have the docs from companies that sell 1-Wire systems that make recommendations like i showed you.
Also some say "loop the shielding trough" others say "loop the shielding trough and connect it on one side".


When i looked at 1-Wire first before 2 years and decide to use it everything was clear.
Now i have everywhere CAT 6 for everything cause its relatively cheap.
It's time to connect now everything and maybe i was reading to much in forums and
on seller stuff and it confused me.

If i look at Dallas/Maxim and "1-Wire-Design Guide v1.0-1" or "1-Wire Application Guide 1.03" i think
its best to really just use 3 wires (DATA/GND/5Vcc).

Only thing is that i used shielded CAT6 and didn't even know that unshielded CAT6 exist.
I know that in the U.S. they use allot of unshielded CAT5 (UTP) cable but CAT6 UTP is new to me.
Here in Germany since years shielded cable is standard.
Even for my AC power i used shielded cables to have no EMC/EMI between them and my Network/Home Automation.

Hm, so the only question left is: To loop or not to loop the unused wires and shield from slave to slave.
6  Using Arduino / Networking, Protocols, and Devices / Re: 1-Wire Vcc GND - connect to Data GND on sensors? on: April 01, 2014, 12:54:39 pm
There are allot of places...
For example: http://1wire.org/index.html?target=p_2.html&lang=en-us
and: http://www.fischer-net.de/hausautomation/haustechnik/1-wire/26-1-wire-belegung-kabel-stecker.html

I don't like parasite mode - extra 5Vcc is more stable and the CAT cable has enough wires smiley

Sure, the idea is to also shield the 5Vcc - but nowhere i found what to do with the second GND.
It only makes sense to me like i draw it. If you only connect one side you have a big antenna.

I was looking for a circuit off a ready made sensor from some company's to see what they to.
But sure, they don't show it that you don't steel there circuit.
Also all the PCB pictures are so blurry and small that you see nothing.

I already made the temp sensor from my circuit on a 0,32x0,98" veroboard (damn that 0805 SMD ferrite bead is small).
Now i need to solder the sensor to the CAT cable (for the in-floor heating) that i can lay my laminate floor and then i have
no longer access to it.
Unsure what to do with the GND.
7  Using Arduino / Networking, Protocols, and Devices / 1-Wire Vcc GND - connect to Data GND on sensors? on: April 01, 2014, 09:32:51 am
Hi,

I'm a little confused.
The suggestion is to use one pair of the CAT cable for Data and Data GND
and another pair for Vcc (5V) and GND.

Does that mean on my sensors i connect them together?
If not i think the extra GND for Vcc would be useless.
But on this premade DS18B20 they just pass the GND through: http://www.fuchs-shop.com/download/manuals_for_t-sense_05-22-08.pdf

In the attachment are my own sensor circuits - there you can see better what i mean.
8  Community / Exhibition / Gallery / Re: Library for time zone conversions and automatic DST adjustments on: October 31, 2013, 12:48:24 pm
NTP sends UTC only, without adjustments for daylight time or time zone.
Thats the reason i was asking. So i can do it like my router with your library.
There i can set the Time Zone and NTP Time Server and have a Auto Daylight Savings Time checkbox.

Now i see "the Time library will function as a software RTC without additional hardware" in the readme.
So the first sentence "A primary aim of this library is to allow a Real Time Clock (RTC)" did confuse me.
9  Community / Exhibition / Gallery / Re: Library for time zone conversions and automatic DST adjustments on: October 31, 2013, 08:51:45 am
Hi,

this library works only with RTC's?
Is there something like "Auto Daylight Savings Time" for ntp?
10  Using Arduino / Project Guidance / Re: Need advice: NodeJS + Arduino wirelessly on: October 30, 2013, 11:58:38 am
Why are you hung up on using NodeJS, whatever it is?
Its beside Websockets the biggest thing since years: https://www.udemy.com/blog/learn-node-js/
Johnny-Five at  NodeConf 2012:

@neilff, i don't know what exactly you want to do. Johnny-Five is great but i think for stuff like Home Automation i don't
like the idea of having the logic on the Server.
I'm also locking for the best way for my interface and i thing MQTT is the way to go.
With Johnny-Five there is to much data if you want to use Ethernet.
I also thing MQTT is more secure: http://readwrite.com/2011/11/22/ibms-andy-piper-part-2-how-mqt

At the moment I'm testing HiveMQ with Paho MQTT JavaScript Client (Eclipse/IBM).
HiveMQ has build in Websocket and there is no need for other stuff like node.js, socket.io, Mosquitto...
Sure you need a machine running with a MQTT Broker (HiveMQ) and for me the decision to make now
is if i use Paho MQTT JavaScript (client-side) or node.js (server-side).
11  Using Arduino / Project Guidance / Re: what do you call the thing that connects to the spinning part of the motor? on: February 18, 2013, 01:11:33 am
The thing that sticks out and you can attach things to it smiley-yell
12  Using Arduino / Project Guidance / Re: what do you call the thing that connects to the spinning part of the motor? on: February 17, 2013, 08:52:14 pm
Shaft coupling
Something like this put smaller: http://www.reichelt.de/Potiknoepfe/ACHSKUPPLUNG-2/3/index.html?;ARTICLE=42133
13  Using Arduino / Project Guidance / Re: Clean and energy efficient LED dimming on: February 17, 2013, 08:47:26 pm
@lax123, i thank you that you want to help me. But that is basic stuff i know.

And this calculator shows what i don't understand. Why so big and short cables for LED's?
I read stuff like 0.75mm2 - 1.5mm2 on most sides.
But if you look at eldoLED POWERdrive they write 3 meters to the LEDs.
And they write 0.2mm2 per 1 ampere.
They also wrote somewhere that 6 meters is no problem with CAT cable and also wrote that
they have customers who made up to 50 meters.

What i can't find is a answerer to PWM over longer distance.
If i have a LED driver with PWM in - how long can i make the PWM line from the Arfuino
to the driver.

There is also the option to dim analog. This would change the color temperature a little.
But i can't see in the Cree datasheets what color temperature at which ampere.
They write color temperatures from 2600 to 4300 for the XP-E High-Efficiency White LEDs.

Damn is this LED stuff complicated when it comes to dimming.
I wish i had a oscilloscope smiley-grin
14  Using Arduino / Project Guidance / Re: Clean and energy efficient LED dimming on: February 16, 2013, 03:50:23 pm
0.5 Meter?
It's a house. There are 5-10 meters...
I found this driver: http://www.leds.de/out/media/KSQ.pdf
And they write to make the cable from the supply not longer then 1,5 meters.
Or is it that they assume that power cables are always unshielded?
15  Using Arduino / Project Guidance / Re: Clean and energy efficient LED dimming on: February 16, 2013, 02:26:05 am
Ok, i did some measuring as you can see in the attachment.
I cant figure out the driver circuit cause its to small.
But there is a R25 and 3R00 on the PCB.
If i look at the M7201 data sheet that would mean they drive the LEDs with 0.1 / 0,25Ω = 400mA
That is close to my measurement.
If the 0.25Ω and 3Ω resistors are parallel its right: 0.1 / 0.23Ω = 430mA

If i look at the CRI and Color temperature and everything i bet they are Cree XLamp  XP-E High-Efficiency White LEDs. http://www.rapidonline.com/pdf/55-2568.pdf
But if the forward voltage is 3V, why do i measure 9V?
Shouldn't it be: 12V - 3 x 3V = 3V

So from all the reading around it looks like the driver needs to be near the LEDs.
So i need a third wire for PWM?
But how about the PWM cable length?
Pages: [1] 2 3 ... 7