ESP32: A Fatal Error

September 1st, 2018

If you get this message when trying to flash an ESP32:

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

You may need to reboot it while flashing so the computer will recognize it. You should be able to trigger a reboot into flashing mode by holding down the BOOT button and giving the EN button a press. Do this while the esptool is “Connecting…”, and it should connect and write with no issues. You may need to try this several times before the tool will see it and connect.

This is what a successful flash looks like:

# make -j flash
Python requirements are satisfied.
Flashing binaries to serial port /COM4 (app at offset 0x10000 )...
esptool.py v2.5.0
Serial port C:/msys32/COM4
Connecting........_
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
MAC: xx:xx:xx:xx:xx:xx
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0220
Compressed 21184 bytes to 12571...
Wrote 21184 bytes (12571 compressed) at 0x00001000 in 1.1 seconds (effective 151.3 kbit/s)...
Hash of data verified.
Compressed 138336 bytes to 68372...
Wrote 138336 bytes (68372 compressed) at 0x00010000 in 6.1 seconds (effective 181.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 1068.5 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Read a CSV file into columns

May 6th, 2016

This command will read a CSV file, and display it as columns. This also works on Windows if you have Cygwin installed.

column -t -s"," test.csv

Example CSV columns

MySQL Dump And Restore Database Table With Compression

August 30th, 2014

mysqldump --no-create-info -uxxxx -pxxxx Database ATable | gzip -9 > xxxx.sql.gz

zcat xxxx.sql.gz | mysql -uxxxx -pxxxx Database

Setting Up Zend Framework 2 Autoloader

May 13th, 2014

If you’re like me, you like to dig into the belly of things and twist them to your own uses. Tonight, I’ve been monkeying around with ZF2 autoloaders, and working out how they function.

I store my ZF install in a dir (Zend/) in my include path, so I don’t have to maintain copies for each site on my server.

Some useful notes on this:

The stock ZF2 download does not include a pre-generated classmap file. To generate this, go into the default unpacked archive folder, into bin/ and run this command:

php classmap_generator.php -l "/usr/share/php/Zend/"

[code language=”php”]
// How to get an absolute path to the generated classmap file (return: /usr/share/php/Zend/autoload_classmap.php)
$classmapPath = stream_resolve_include_path(‘Zend/autoload_classmap.php’);

// How to get the autoload up and running
require_once ‘Zend/Loader/ClassMapAutoloader.php’;
$autoloader = new Zend\Loader\ClassMapAutoloader();
$autoloader->registerAutoloadMap($classmapPath);
$autoloader->register();
[/code]

That’s all for tonight folks!

Find MySQL Foreign Keys

January 9th, 2014

Sometimes you need a quick way to find out what foreign key is blocking your action.

[code]SELECT
CONCAT(table_name, ‘.’, column_name) AS ‘foreign key’,
CONCAT(referenced_table_name, ‘.’, referenced_column_name) AS ‘references’
FROM information_schema.key_column_usage
WHERE referenced_table_name IS NOT NULL;[/code]

http://www.conandalton.net/2008/09/list-foreign-key-constraints-in-oracle.html

WordPress - Entries (RSS) and Comments (RSS) - © 2011 Ben Dauphinee