An archive of community.esquilo.io as of Saturday January 26, 2019.

# It would be awesome to have recipes!

jsaavedra

Guys, I can't hardly wait to have the board in my hands.... In preparation and anticipation, could you please work on a few recipes to control servos, motors, leds, etc. Since most of us are new to Squirrel, that would be a nice help.

Thanks!

patrick

Good to hear from you Javier! Thanks for the suggestion. We will be adding recipes very soon. We'll post back here with the details.

By the way, we are packing up the boards to send out now. They should all go out by next week.

cswiger

I'm looking for prior-art or will look at creating code for reading dht22/rth03 and ds18b20 (OneWire) temperature humidity sensors.

patrick

We don't have a OneWire lib yet, but we were talking about it for the DS18B20 just a couple of days ago. Now it's clearly a high priority. We'll post back here with a time estimate within a day or two.

cswiger

Here's a nut on github for servo control: https://github.com/esquiloio/lib/blob/master/motors/servo/servo.nut

I'll be porting a PID library over, when I get a chance, as I need it for motor control, and nice to see there's a quadrature decoder input for Esquilo-in-the-loop servo's (like positioning old printer carriage assemblies).

patrick

We've started a recipes page in the docs: https://www.esquilo.io/docs/#!recipes.

Currently it's just some software-only things:

• Send an email
• Send a text
• Send an IFTTT event

We'll trickle more out over time. Please post ideas you'd like to see and your own recipes to the community.

If you don't find something in the recipes page, good places to look are the usage examples in these:

JefferyS

I was just actually looking to see if I could do this. I need to hookup about 6 ds18b20 OneWire Temp sensors for a project to monitor the temp of anodizing tanks. I hope your able to get this out fairly quickly. I was thinking I could make a web page to display all the temps of each tank and be able to view it from anywhere being that the Esquilo has WiFi.

Scott_Shumate

1-Wire is a pretty important feature for us to add. We plan to support the Dallas sensors as well as similar 1-Wire type protocols like those used on the NeoPixels. We prototyped support for 1-Wire on Esquilo using the UART and DMA since the Kinetis ARM does not support OneWire in hardware. Since Esquilo uses an RTOS, bit-banging with high precision is out of the question.

JefferyS

Sorry Scott but I'm a bit new to micro controllers, so what do you mean "bit-banging with high precision is out of the question" and how will that affect the reading of the Temp sensors if any?

Does the Arduino support OneWire in hardware? I know you have to use the OneWire library but understood that to take the OneWire data coming from the OneWire device and make it useful to use as it is a complicated stream of data coming from the device.

Thanks,

Jeffery

patrick

Hi Jeffery,

Bit-banging is a technique used to implement digital communication protocols in firmware, usually when there is no direct hardware support. It involves wiggling and reading GPIO pins with very precise timing. For example, here's how the Arduino library writes a single bit to 1-wire:

void OneWire::write_bit(uint8_t v)
{
volatile IO_REG_TYPE *reg IO_REG_ASM = baseReg;

if (v & 1) {
noInterrupts();
DIRECT_MODE_OUTPUT(reg, mask);	// drive output low
delayMicroseconds(10);
DIRECT_WRITE_HIGH(reg, mask);	// drive output high
interrupts();
delayMicroseconds(55);
} else {
noInterrupts();
DIRECT_MODE_OUTPUT(reg, mask);	// drive output low
delayMicroseconds(65);
DIRECT_WRITE_HIGH(reg, mask);	// drive output high
interrupts();
delayMicroseconds(5);
}
}

1-Wire is one of those protocols that has no hardware support on the CPU we or Arduino uses. Because Arduino isn't running a real-time operating system, it can ensure nothing interrupts and makes the delayMicroseconds calls longer than requested, etc. (i.e. bit-banging with high precision"). Esquilo is running an RTOS, so the code can be interrupted by other tasks (e.g. TCP/IP stack) and throw off the timing.

The 1-Wire protocol is similar enough to a UART that we can get the built-in UART hardware (that will ensure timing) to do it, but it takes some experimenting and testing. Doing this is high on our list of priorities, but just haven't gotten to it yet.

rockethacker

can't wait for the onewire temp probe support! it is the only thing standing in the way of me using the esquilo to brew beer!

just curious, electric imp appears to support it. does that code port over, or are there significant hardware differences that make this nontrivial? https://gist.github.com/smittytone/97e57909105c9e0d31aa

patrick

That Electric Imp gist is based on the same idea, use the UART hardware. Want to try porting it over to use our UART lib?

JefferyS

Thanks for explaining how the OneWire works Patrick.