Author Topic: Using an ESP32 as the CPU for a still.  (Read 7618 times)

0 Members and 1 Guest are viewing this topic.

Offline ketel3

  • Admin
  • Posts: 1377
  • Eparrot.org
Re: Using an ESP32 as the CPU for a still.
« Reply #20 on: February 20, 2019, 10:06:34 PM »
Ok ok I just was thinking about duplex ftp to make it working two ways instead of a one way info channel!but I'am on the wrong track with that.

But you are great in finding solution I see.
A open port is not such a big isue as I never had any problems and use port forwarding for almost 10 years,BUT always be carefull your right on that,a bigger isue is a weak password as I had a huge problem in the past and some one hacked a part of my website,I can tell you the feeling you have after that is awefull.

Ok back to buisiness,yep a static ip adress avoid later on that you have to solve a puzzle  :o

I hope you can show us soon some screen shots to have a idea how it looks.
Better bad weather than no weather

Offline Hooch

  • Posts: 97
Re: Using an ESP32 as the CPU for a still.
« Reply #21 on: February 22, 2019, 03:13:41 AM »
Today I am beating my head on the desk....  :o

So I have written debug code for the DS sensors, since getting them to work right is the star of the show.

So I have tweaked the code so there can be more than one one wire bus or OWB.  Why to split up the sensors since they all need long cables, and that may be an issue, but I wanted to check since my sensors have about 120 ft of cable in total.

So I have it working for two buses..  now the problem seems to between the 3 encapsulated sensors I got for xmas, and i can only have one on a bus instance.  Very frustrating.... don't have a 4.7k resistor to create another bus to try it out.. (wait.. 2x10k in parallell = 5k)

All this because i need to build an assignment table and save it so the next time we reset, we know what sensor is sensing what, and the calibration offset and any other bits we need to remember or customize.  This is something you need to do on a semi-frequent basis, and when the code is in the wild absolutely crucial for it's success. I suppose you could apple it, and have a unique bus for each sensor and this would not be an issue except for there ain't that many pins.

And for security, really is it going to be on all the time?  No, just for distilling.

Ok gotta code... try three buses for the picture.


Offline Hooch

  • Posts: 97
Re: Using an ESP32 as the CPU for a still.
« Reply #22 on: February 22, 2019, 05:30:50 AM »
Pass: 767
Finding devices on bus: 0
  0 : 9402109245abc028
  1 : 18000008f3d6d428
  2 : 4e000008f3ed4a28
Finding devices on bus: 1
  0 : 0900000a9207a928
  1 : 7e02149245953728
Finding devices on bus: 2
  0 : 5902109245b6e528
  1 : 75000008f28e4f28
  2 : 620115905fa8ff28

ok so no picture... but three owb sniffing away... should try and figure out why..

the code that does this is:

Code: [Select]
  vTaskDelay(2000.0 / portTICK_PERIOD_MS);

  owb_rmt_driver_info rmt_driver_info;
  owb = owb_rmt_initialize(&rmt_driver_info, GPIO_DS18B20_0, RMT_CHANNEL_1, RMT_CHANNEL_0);
  owb_use_crc(owb, true);  // enable CRC check for ROM code
  printf("owb initialized\n");
bool bv = false;
    printf("status code %d",owb_reset(owb, &bv));
      if (bv) {
        printf("Devices  Present:\n");
      } else {
        printf("Nothing there! :\n");

      }
 
int passcount = 0;
  while (1) {
    printf("\n");
     printf("Pass: %d\n", passcount++);

  for ( int i = 0; i < 3; i++) {

    printf("Finding devices on bus: %d\n", i);
    OneWireBus_ROMCode device_rom_codes[MAX_DEVICES] = {0};
    int num_devices = 0;
    OneWireBus_SearchState search_state = {0};
    bool found = false;
    owb_search_first(owb, &search_state, &found);
    while (found)
    {
      char rom_code_s[17];
      owb_string_from_rom_code(search_state.rom_code, rom_code_s, sizeof(rom_code_s));
      printf("  %d : %s\n", num_devices, rom_code_s);
      device_rom_codes[num_devices] = search_state.rom_code;
      ++num_devices;
      owb_search_next(owb, &search_state, &found);
    }
        owb_uninitialize(owb);

          owb_rmt_driver_info rmt_driver_info;
        if (i == 1) {
          owb = owb_rmt_initialize(&rmt_driver_info, GPIO_DS18B20_0, RMT_CHANNEL_1, RMT_CHANNEL_0);
          owb_use_crc(owb, true);  // enable CRC check for ROM code
        } else if (i== 2) {
          owb = owb_rmt_initialize(&rmt_driver_info, GPIO_DS18B20_1, RMT_CHANNEL_1, RMT_CHANNEL_0);
          owb_use_crc(owb, true);  // enable CRC check for ROM code
        } else {
          owb = owb_rmt_initialize(&rmt_driver_info, GPIO_DS18B20_2, RMT_CHANNEL_1, RMT_CHANNEL_0);
          owb_use_crc(owb, true);  // enable CRC check for ROM code
        }
  }
            vTaskDelay(2000.0 / portTICK_PERIOD_MS);


}


 
There is a glitch somewhere it looks like that data is in wrong order lsb<>msb

So farg it..  It should hold together enough to code together the initialization routines.

But also I think it is time to say yes an ESP32 will run a still, and to start up a project here to develop it. 

but first..  /thumbsUp /cocktail /drunk

Offline ketel3

  • Admin
  • Posts: 1377
  • Eparrot.org
Re: Using an ESP32 as the CPU for a still.
« Reply #23 on: February 22, 2019, 12:57:09 PM »
That is the great thing about one wire sensors their unqiue sensor code  :)

I use a weather prog for my outdoor sensors and in case of problems it is great as it looks for each individual sensor code .
For the eparrot I use the resistors,not in the beginning and found out that a short moment there is no sensor data and that generates the eparrot alarms  ,for my home one wire network no resistors and with cables up to 18 meters no problems but if there is no data for say X milli seconds it is no problem.

So depending what you use the ds sensors for you need resistors  or not.
Esp32 is not so easy as expected?




Better bad weather than no weather

Offline Hooch

  • Posts: 97
Re: Using an ESP32 as the CPU for a still.
« Reply #24 on: February 25, 2019, 09:18:06 PM »
In this situation it is the new DS sensors that are having a problem.   Why this is happening requires a nice scope which i don't have. 

Quote
Esp32 is not so easy as expected?

No it is easy, if you treat it like an arduino.  But there are way more "tools" available and each of those need some tinker time to figure out.  So far I have about 24 hours of coding in on this to get here, which is a command line and output, multiple motors running independently and concurrently, and multiple one wire buses implemented on a hardware uart.   

To get where I think it should be is about another 400 hours of coding, and each of those hours seems to be a battle royal to get uninterrupted. 

Offline ketel3

  • Admin
  • Posts: 1377
  • Eparrot.org
Re: Using an ESP32 as the CPU for a still.
« Reply #25 on: February 25, 2019, 09:46:48 PM »
My goodness  more than 400 hours of coding,and you still say it is easy ,respect Hooch.

You say the new ds sensors giving the problems .......are you sure they all are the same as there a more types,I have a couple of different ones ,directly from Maxim as I ordered free samples a long time ago.
Better bad weather than no weather

Offline Hooch

  • Posts: 97
Re: Using an ESP32 as the CPU for a still.
« Reply #26 on: February 25, 2019, 11:04:31 PM »
Sadly no I really don't think they are the genuine article, they were the 3 for $10 at amazon one of the too good to be true deals, hence the problem.

400 hours.. yeah there are a lot of functions that have to be developed. 

Offline ketel3

  • Admin
  • Posts: 1377
  • Eparrot.org
Re: Using an ESP32 as the CPU for a still.
« Reply #27 on: February 25, 2019, 11:09:45 PM »
Just bad luck ,as the,ones I had from ebay were also good.


Better bad weather than no weather