Project Mashup – Converting an RC Enzo into an Arduino powerhouse

Standard

A few pieces fell in place over the last 24 hours that are calling me to make this project. I was gifted an awesome 1:16 scale Ferrari Enzo RC car, and in hacker form, I want to mash it together with a Seeed Studio Linkit ONE. I will be acquiring another one than the one I have in my Lego case v3, as I love that one so.

I took some pre-conversion pictures so that I can do a full build log.


Stock website:

http://silverlit.com/toy/power-in-speed-licensed-116-scale-racer-86027-ferrari-enzo

Product pictures:

86027_2[1]86027_1[1]


My pictures:

20150130_13292520150130_13294620150130_13300820150130_132356


Plans:

Since the LinkIt ONE has GPS, I plan on having a data recorder in it. I will also leverage wifi and bluetooth for connectivity. I also like the idea of using the audio out to drive a speaker to add realistic sounds. Vroom!!

I would love to design a distance sensing array to give this outright automation abilities. I will be trying very hard to keep the look and feel of the original shell, so that adds a lot of restrictions on placement and size. I have hope, and will post updates on my IR blaster arrays.

Thoughts?

Advertisements

Almond+ unboxing and benchmarking

Standard

There it sits. Nothing that outstanding in looks. Nothing outstanding in sound. But it knows it’s better than what you think of it. Under the plastic case, behind the screen, is $400 worth of technology, and the realization of a dream of a few engineers who asked “why not?”

20150124_09232120150124_092338

As I looked away from my new Almond+, I saw my WRT54GS and my old Almond. I fell in love with my Almond shortly after my Linksys E3000 overheated. I needed a reliable router, and there it was on Amazon with thousands of 5 star reviews. I can honestly say I am now one of those 5 star reviews. The simplicity, size and performance out of the Almond are fantastic. The screen that I initially thought was a sales gimmick became my main way of administrating my network. Its size is smaller than my cable modem, a SB6120.

Since I was able to score an early model, I decided to do an unboxing and benchmarking for anyone who might have questions as to what this thing can do.

For my test, here’s the setup:

ISP: Comcrap 100 Mbps/25 (25 or 12 Mbps, I’m not sure)

Modem: Personal SB6120 with updated firmware. DOCIS 3.0.

Testing devices: HP Elitebook 8440p with gigabit Ethernet and 5GHz N chipset, Samsung Note3, testing on N bands

Routers: WRT54GS flashed with DDWRT, Almond, Almond+. Testing was done on fastest bands available at < 3 feet.

Benchmarks were performed using Speedtest.net’s website in IE or the native Android App. Results were as follows:

Continue reading

LinkIt ONE Lego Case Versions

Standard

I found I had collections of pictures from each of my Lego case versions. Since the internet loves lessons and OC, here you go!


Version 1:

20141025_173414

Shortcomings:

  • Plugging in anything was super hard, and don’t even think about the micro SD card
  • Reset button was hidden

Version 2:

20141112_20331620141112_20340520141112_20354220141112_203710Shortcomings:

  • Fragile
  • Held the board in by pinching it. This is not the best way of doing things
  • There was still a little too much movement of parts

Version 3:

Full build log link:

https://deltainnovativelabs.wordpress.com/2015/01/15/linkit-one-lego-case-v3/

20141118_22385220141118_223904

20150105_12412420141118_223922

20150105_12414020150105_12432120150105_12434920150105_12444220150105_12451820150105_12454220150105_12470120150105_12474020150105_12482720150105_12483920150105_124922

Shortcomings:

  • Shield probably won’t fit
  • People constantly try to play with the rollers thinking it’ll do something

LinkIt ONE Lego Case v3

Standard

This build was something I did on my own to protect the LinkIt ONE that I carry with me so dearly. With all of its modules, it has become my main go-to unit, and for its price, it cannot be beaten for a while. Where it is lacking is in the durability department. Those cords are dangling all over the place, and just asking to be broken. About 4 hours of tinkering and using went into this design, and the only shortcoming that I am finding is that it probably does not accommodate shields. There are worse things, so we move on.

20150105_12412420150105_124140

This is compact and just big enough to hold all the antennas and battery in place. The pieces used were what I had available, and I’m sure that each person will have a slight variant. Have fun with it.

Step 1:

20150105_124922

Lay out the bottom pieces like the picture has. The large ones are two 4×12 flat bricks with a 1×8 in between. The 1×4 on top is smooth to wedge the battery in place to prevent movement.

Step 2:

20150105_124839

The frame and the build of the case is a little unique because the LinkIt is only 7 bricks wide. In this picture, you are building up the battery and cellular voids. All the gray angles are the same, and in the bottom right is a 1×4 and 1×3 to build up support for the wifi/bt antenna.

Step 3:

20150105_124827

Put your battery in place. It’s now or never.

Step 4:

20150105_124740

This is where the magic happens. There’s two 1×8 flats for the LinkIt to rest on, but the 1×4 on the left and the 1×2 on the bottom right keep it in place. Don’t’ forget to add the 1×4 you see in the bottom right.

Step 5:

20150105_124701

Here is where you get your LinkIt in place. Set it on top of the smooth bricks you put in during the 4th step. Build the wifi/bt antenna enclosure you see closest to you with the white bricks. The black bricks are full 16 length. Make sure the cell antenna is pushed completely in so the wifi/bt holder won’t damage it.

Step 6:

20150105_124542

Put them in place, making sure the cord for the wifi/bt antenna does a little loop that you see in the picture. That will contain the extra length and relieve stress from the contact points. Build the set of Legos you see closest to you. This will hold the GPS.

Step 7:

20150105_124518

Build the axle with the rims on it. These have just the right spacing to hold the board and GPS in place. The axel is 8 long with ½ brick length on each end.

Step 8:

20150105_124442

Going clockwise around the picture, the length of the large pieces are 12, 8, and 10. Make sure you have the black connector on the first one, and the 4 and 6 length flat Legos on for spacing in the next steps. The axel goes into the third from the right hole on the first length, and the fifth from the right hole on the third piece.

Step 9:

20150105_124349

Put the pieces in place from step 8, making sure the LinkIt and the GPS are sitting easily in place. At this point, the board should not move. Grab your two 2×6 flat pieces.

Step 10:

20150105_124321

Put those 2×6 pieces on either side of the top of the case. Next grab two 2×8, two 2×4, and one 1×4 flat pieces and assemble like you see in the picture. This is going to go on top.

Step 11:

20150105_124124

Put the Legos assembled in step ten on top, making sure the GPS antenna is seated inside without forcing anything. At this point, make sure everything is pushed together. Then shake around like there’s no tomorrow. The only noise you should hear is a slight movement of the battery.

Step 12:

Build awesome things.

LinkIt ONE RTC Example Code

Standard

When I was trying out all the different parts of the LinkIt, I wondered if there was an RTC onboard. Loovee told me there was, but that the example was not complete at this point in time.

I took this situation upon myself to make a complete example for anyone else out there who wants to use the LinkIt’s onboard RTC. In this discovery of things, I found that the RTC can be set back to 1/1/2004 if the battery and USB power supply are both disconnected. I made a loop in my code that will turn on the GPS to resync the GMT automatically in the background, the only thing that needs to happen is for the GPS to turn on. This is why in my more complex programs, I didn’t see the resetting behavior.

Here is a screenshot of what it looks like when the GPS has finally synced the time:

LDateTime working demo

And here is the code that runs the whole thing:

#include <LDateTime.h>
#include <LGPS.h>

datetimeInfo t;
unsigned int rtc;
int gps_on=0; //This is used to check if the GPS needs to be turned off

void setup() {
 Serial.begin(115200);
 }

void loop() {
 
 LDateTime.getTime(&t);
 LDateTime.getRtc(&rtc);
 
 Serial.print("Current GMT: ");
 Serial.print(t.mon);
 Serial.print("/");
 Serial.print(t.day);
 Serial.print("/");
 Serial.print(t.year);
 Serial.print(" ");
 Serial.print(t.hour);
 Serial.print(":");
 Serial.print(t.min);
 Serial.print(":");
 Serial.print(t.sec);
 
 Serial.print(" Seconds since 1/1/1970 GMT: ");
 Serial.println(rtc);
 
 //Turning on the GPS syncs up the RTC with the GPS time.
 //If the battery is pulled, the RTC goes back a couple years.

 //Turning on the GPS syncs up the RTC with the GPS time.
 //If the GPS is needed, t.year will be 2004. This will start this loop.
 if ((gps_on != 1) && (t.year < 2010))
 {
 Serial.println("Using GPS to sync GMT. Please wait...");
 LGPS.powerOn();
 gps_on = 1;
 }

 //If the GPS has synced the RTC, the year will be 2015 or greater.
 if ((gps_on == 1) && (t.year >= 2015))
 {
 LGPS.powerOff();
 Serial.println("Synced! Turning off GPS. Please wait...");
 gps_on = 0;
 }
 
 //Wait one second before getting new time.
 delay(1000);
 }

PL/SQL find dependencies in other objects (v2)

Standard

I found that my prior code did not account for dependencies in views. Dammit, but there must be a way. I found it, and wrapped it up into one  semi-organized chunk of code for audit purposes. As always, let me know what you think.

--FIRST WE NEED TO DROP THE TABLES SO WE CAN USE THEM AGAIN.
DROP TABLE TEMP_DEPENDENCIES;
DROP TABLE TEMP_OBJECTS;

--NOW WE NEED TO MAKE SURE THEY ARE SET UP PROPERLY
CREATE TABLE TEMP_DEPENDENCIES (
 OBJECT_OWNER VARCHAR(30),
 OBJECT_TYPE VARCHAR(30),
 OBJECT_NAME VARCHAR(30),
 DEPENDANT_OWNER VARCHAR(30),
 DEPENDANT_OBJECT_TYPE VARCHAR(30),
 DEPENDANT_OBJECT VARCHAR(30),
 DEPENDANT_LINE VARCHAR(30)
 );

CREATE TABLE TEMP_OBJECTS (
 OBJECT_OWNER VARCHAR(30),
 OBJECT_TYPE VARCHAR(30),
 OBJECT_NAME VARCHAR(30)
 );

--INSERT ALL OJBECTS OF INTEREST
INSERT INTO TEMP_OBJECTS
WITH OBJECT_OWNERS AS (
 SELECT 'SYS' AS OBJECT_OWNER
 FROM DUAL
 )
SELECT OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME
FROM (
 SELECT OWNER AS OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME
 FROM ALL_OBJECTS
 WHERE OWNER IN (
 SELECT OBJECT_OWNER
 FROM OBJECT_OWNERS
 ) MINUS
 SELECT OWNER AS OBJECT_OWNER,
 'TABLE' AS OBJECT_TYPE,
 OBJECT_NAME
 FROM ALL_OBJECTS
 WHERE OWNER IN (
 SELECT OBJECT_OWNER
 FROM OBJECT_OWNERS
 )
 AND OBJECT_TYPE = 'MATERIALIZED VIEW'
 );

COMMIT;

--THIS LOOP LOOKS AT ALL THE DEPENDENCIES IN THE VIEWS
DECLARE L_CHAR VARCHAR2(32767);

BEGIN
 FOR OBJ IN (SELECT * FROM TEMP_OBJECTS)

 LOOP
 FOR REC IN (SELECT * FROM ALL_VIEWS)

 LOOP L_CHAR := REC.TEXT;
 IF (INSTR(L_CHAR, OBJ.OBJECT_NAME) > 0)
 THEN INSERT INTO TEMP_DEPENDENCIES VALUES (OBJ.OBJECT_OWNER,OBJ.OBJECT_TYPE,OBJ.OBJECT_NAME,REC.OWNER,'VIEW',REC.VIEW_NAME,-1); COMMIT;
 END IF;
 END LOOP;
 END LOOP;
END;

--THIS COMBINES THE VIEW DEPENDENCIES WITH ALL OTHER DEPENDENCIES
INSERT INTO TEMP_DEPENDENCIES
SELECT OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME,
 DEPENDANT_OWNER,
 DEPENDANT_OBJECT_TYPE,
 DEPENDANT_OBJECT,
 DEPENDANT_LINE
FROM TEMP_OBJECTS
INNER JOIN (
 SELECT OWNER AS DEPENDANT_OWNER,
 TYPE AS DEPENDANT_OBJECT_TYPE,
 NAME AS DEPENDANT_OBJECT,
 LINE AS DEPENDANT_LINE,
 TEXT AS DEPENDANT_TEXT
 FROM ALL_SOURCE
 WHERE TEXT NOT LIKE '--%'
 ) DETAILS
 ON INSTR(DETAILS.DEPENDANT_TEXT, TEMP_OBJECTS.OBJECT_NAME) != 0;

COMMIT;

--THIS MAKES SENSE OF THE DEPENDENCIES. IT COMBINES INSTANCES ON MULTIPULE LINES INTO ONE CSV RESULT 
SELECT OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME,
 DEPENDANT_OWNER,
 DEPENDANT_OBJECT_TYPE,
 DEPENDANT_OBJECT,
 SUBSTR(DEPENDANT_LINE, 2, MAX_LEN_DEPENDANT_LINE - 1) AS DEPENDANT_LINE
FROM (
 SELECT OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME,
 DEPENDANT_OWNER,
 DEPENDANT_OBJECT_TYPE,
 DEPENDANT_OBJECT,
 LENGTH(SYS_CONNECT_BY_PATH(DEPENDANT_LINE, ',')) AS LEN_DEPENDANT_LINE,
 MAX(LENGTH(SYS_CONNECT_BY_PATH(DEPENDANT_LINE, ','))) OVER (
 PARTITION BY OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME,
 DEPENDANT_OWNER,
 DEPENDANT_OBJECT_TYPE,
 DEPENDANT_OBJECT
 ) AS MAX_LEN_DEPENDANT_LINE,
 SYS_CONNECT_BY_PATH(DEPENDANT_LINE, ',') AS DEPENDANT_LINE
 FROM (
 SELECT OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME,
 DEPENDANT_OWNER,
 DEPENDANT_OBJECT_TYPE,
 DEPENDANT_OBJECT,
 DEPENDANT_LINE,
 ROW_NUMBER() OVER (
 PARTITION BY OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME,
 DEPENDANT_OWNER,
 DEPENDANT_OBJECT_TYPE,
 DEPENDANT_OBJECT ORDER BY OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME,
 DEPENDANT_OWNER,
 DEPENDANT_OBJECT_TYPE,
 DEPENDANT_OBJECT,
 DEPENDANT_LINE
 ) AS DEPENDANT_OBJECT_LEVEL
 FROM TEMP_DEPENDENCIES
 ) SUBQ START WITH DEPENDANT_OBJECT_LEVEL = 1
 CONNECT BY PRIOR(OBJECT_OWNER || '.' || OBJECT_TYPE || '.' || OBJECT_NAME || '.' || DEPENDANT_OWNER || '.' || DEPENDANT_OBJECT_TYPE || '.' || DEPENDANT_OBJECT || '.' || TO_CHAR(DEPENDANT_OBJECT_LEVEL + 1))
 = (OBJECT_OWNER || '.' || OBJECT_TYPE || '.' || OBJECT_NAME || '.' || DEPENDANT_OWNER || '.' || DEPENDANT_OBJECT_TYPE || '.' || DEPENDANT_OBJECT || '.' || TO_CHAR(DEPENDANT_OBJECT_LEVEL))
 ) CONNECTED_DATA
WHERE LEN_DEPENDANT_LINE = MAX_LEN_DEPENDANT_LINE
ORDER BY OBJECT_OWNER,
 OBJECT_NAME,
 OBJECT_TYPE,
 DEPENDANT_OWNER,
 DEPENDANT_OBJECT_TYPE,
 DEPENDANT_OBJECT

PL SQL Find all objects in other objects

Standard

I wrote some code that allows you to find exactly where all references in scripts (sprocs, views) your objects are. This includes tables, views, indexes, sequences. Run it, and let me know what you think!

WITH OBJECT_OWNERS
AS (
 SELECT 'SYS' AS OBJECT_OWNER
 FROM DUAL
 )
SELECT OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME,
 REFERENCED_IN_OWNER,
 REFERENCED_IN_OBJECT_TYPE,
 REFERENCED_IN_OBJECT,
 REFERENCED_IN_LINE,
 REFERENCED_IN_TEXT
FROM (
 SELECT OBJECT_TYPE,
 OBJECT_NAME,
 OWNER AS OBJECT_OWNER
 FROM ALL_OBJECTS
 WHERE OWNER IN (
 SELECT OBJECT_OWNER
 FROM OBJECT_OWNERS
 ) MINUS
 SELECT 'TABLE' AS OBJECT_TYPE,
 OBJECT_NAME,
 OWNER AS OBJECT_OWNER
 FROM ALL_OBJECTS
 WHERE OWNER IN (
 SELECT OBJECT_OWNER
 FROM OBJECT_OWNERS
 )
 AND OBJECT_TYPE = 'MATERIALIZED VIEW'
 ) QUALIFIER
LEFT JOIN (
 SELECT OWNER AS REFERENCED_IN_OWNER,
 TYPE AS REFERENCED_IN_OBJECT_TYPE,
 NAME AS REFERENCED_IN_OBJECT,
 LINE AS REFERENCED_IN_LINE,
 TEXT AS REFERENCED_IN_TEXT
 FROM ALL_SOURCE
 WHERE TEXT NOT LIKE '--%'
 ) DETAILS
 ON INSTR(DETAILS.REFERENCED_IN_TEXT, QUALIFIER.OBJECT_NAME) != 0
ORDER BY OBJECT_OWNER,
 OBJECT_TYPE,
 OBJECT_NAME,
 REFERENCED_IN_OWNER,
 REFERENCED_IN_OBJECT_TYPE,
 REFERENCED_IN_OBJECT,
 REFERENCED_IN_LINE